home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / SHDK_2 / SKYHAWK.RR < prev    next >
Text File  |  1992-06-15  |  112KB  |  3,396 lines

  1. $$IndexTag = ƒ
  2.  
  3.                                 ƒUNIT ƒDEPENDENCIES
  4. .
  5.                                  D  S  S  T  T  T  T  T  T
  6.                                  O  H  H  P  P  P  P  P  P
  7.                                  S  L  U  C  D  I  M  S  W
  8.                                  |  I  T  R  O  N  E  T  I
  9.                       +--uses--> |  S  I  T  S  L  M  R  N
  10.                       |          |  T  L  |  |  I  C  I  D
  11.                       |          |  |  P  |  |  N  H  N  O
  12.                       |          |  |  K  |  |  E  K  G  W
  13.                       |          |  |  |  |  |  |  |  |  |
  14.                       ƒShƒClrDef   -  -  -  X  -  -  -  -  X
  15.                       ƒShƒCmdLin   X  X  X  -  -  -  -  -  -
  16.                       ƒShƒCmplx    -  -  -  -  -  -  -  -  -
  17.                       ƒShƒCrcChk   X  -  -  -  -  -  -  -  -
  18.                       ƒShƒDatPk    X  -  -  -  -  -  -  -  -
  19.                       ƒShƒErrMsg   -  -  -  -  -  -  -  -  -
  20.                       ƒShƒList     -  -  -  -  -  X  X  X  -
  21.                       ƒShƒLngStr   -  -  -  -  -  X  X  X  -
  22.                       ƒShƒUtilPk   -  -  -  -  X  -  -  X  -
  23.  
  24. unit ƒShƒClrDef
  25.              {Black text}                    {Blue text}
  26.              ƒBlackOnBlack       = ƒ$00;       ƒBlueOnBlack        = ƒ$01;
  27.              ƒBlackOnBlue        = ƒ$10;       ƒBlueOnBlue         = ƒ$11;
  28.              ƒBlackOnGreen       = ƒ$20;       ƒBlueOnGreen        = ƒ$21;
  29.              ƒBlackOnCyan        = ƒ$30;       ƒBlueOnCyan         = ƒ$31;
  30.              ƒBlackOnRed         = ƒ$40;       ƒBlueOnRed          = ƒ$41;
  31.              ƒBlackOnMagenta     = ƒ$50;       ƒBlueOnMagenta      = ƒ$51;
  32.              ƒBlackOnBrown       = ƒ$60;       ƒBlueOnBrown        = ƒ$61;
  33.              ƒBlackOnLtGray      = ƒ$70;       ƒBlueOnLtGray       = ƒ$71;
  34.  
  35. unit ƒShƒClrDef
  36.              {Green text}                    {Cyan text}
  37.              ƒGreenOnBlack       = ƒ$02;       ƒCyanOnBlack        = ƒ$03;
  38.              ƒGreenOnBlue        = ƒ$12;       ƒCyanOnBlue         = ƒ$13;
  39.              ƒGreenOnGreen       = ƒ$22;       ƒCyanOnGreen        = ƒ$23;
  40.              ƒGreenOnCyan        = ƒ$32;       ƒCyanOnCyan         = ƒ$33;
  41.              ƒGreenOnRed         = ƒ$42;       ƒCyanOnRed          = ƒ$43;
  42.              ƒGreenOnMagenta     = ƒ$52;       ƒCyanOnMagenta      = ƒ$53;
  43.              ƒGreenOnBrown       = ƒ$62;       ƒCyanOnBrown        = ƒ$63;
  44.              ƒGreenOnLtGray      = ƒ$72;       ƒCyanOnLtGray       = ƒ$73;
  45.  
  46. unit ƒShƒClrDef
  47.              {Red text}                      {Magenta text}
  48.              ƒRedOnBlack         = ƒ$04;       ƒMagentaOnBlack     = ƒ$05;
  49.              ƒRedOnBlue          = ƒ$14;       ƒMagentaOnBlue      = ƒ$15;
  50.              ƒRedOnGreen         = ƒ$24;       ƒMagentaOnGreen     = ƒ$25;
  51.              ƒRedOnCyan          = ƒ$34;       ƒMagentaOnCyan      = ƒ$35;
  52.              ƒRedOnRed           = ƒ$44;       ƒMagentaOnRed       = ƒ$45;
  53.              ƒRedOnMagenta       = ƒ$54;       ƒMagentaOnMagenta   = ƒ$55;
  54.              ƒRedOnBrown         = ƒ$64;       ƒMagentaOnBrown     = ƒ$65;
  55.              ƒRedOnLtGray        = ƒ$74;       ƒMagentaOnLtGray    = ƒ$75;
  56.  
  57. unit ƒShƒClrDef
  58.              {Brown text}                    {Light Gray text}
  59.              ƒBrownOnBlack       = ƒ$06;       ƒLtGrayOnBlack      = ƒ$07;
  60.              ƒBrownOnBlue        = ƒ$16;       ƒLtGrayOnBlue       = ƒ$17;
  61.              ƒBrownOnGreen       = ƒ$26;       ƒLtGrayOnGreen      = ƒ$27;
  62.              ƒBrownOnCyan        = ƒ$36;       ƒLtGrayOnCyan       = ƒ$37;
  63.              ƒBrownOnRed         = ƒ$46;       ƒLtGrayOnRed        = ƒ$47;
  64.              ƒBrownOnMagenta     = ƒ$56;       ƒLtGrayOnMagenta    = ƒ$57;
  65.              ƒBrownOnBrown       = ƒ$66;       ƒLtGrayOnBrown      = ƒ$67;
  66.              ƒBrownOnLtGray      = ƒ$76;       ƒLtGrayOnLtGray     = ƒ$77;
  67.  
  68. unit ƒShƒClrDef
  69.              {Dark Gray text}                {Light Blue text}
  70.              ƒDkGrayOnBlack      = ƒ$08;       ƒLtBlueOnBlack      = ƒ$09;
  71.              ƒDkGrayOnBlue       = ƒ$18;       ƒLtBlueOnBlue       = ƒ$19;
  72.              ƒDkGrayOnGreen      = ƒ$28;       ƒLtBlueOnGreen      = ƒ$29;
  73.              ƒDkGrayOnCyan       = ƒ$38;       ƒLtBlueOnCyan       = ƒ$39;
  74.              ƒDkGrayOnRed        = ƒ$48;       ƒLtBlueOnRed        = ƒ$49;
  75.              ƒDkGrayOnMagenta    = ƒ$58;       ƒLtBlueOnMagenta    = ƒ$59;
  76.              ƒDkGrayOnBrown      = ƒ$68;       ƒLtBlueOnBrown      = ƒ$69;
  77.              ƒDkGrayOnLtGray     = ƒ$78;       ƒLtBlueOnLtGray     = ƒ$79;
  78.  
  79. unit ƒShƒClrDef
  80.              {Light Green Text}              {Light Cyan text}
  81.              ƒLtGreenOnBlack     = ƒ$0A;       ƒLtCyanOnBlack      = ƒ$0B;
  82.              ƒLtGreenOnBlue      = ƒ$1A;       ƒLtCyanOnBlue       = ƒ$1B;
  83.              ƒLtGreenOnGreen     = ƒ$2A;       ƒLtCyanOnGreen      = ƒ$2B;
  84.              ƒLtGreenOnCyan      = ƒ$3A;       ƒLtCyanOnCyan       = ƒ$3B;
  85.              ƒLtGreenOnRed       = ƒ$4A;       ƒLtCyanOnRed        = ƒ$4B;
  86.              ƒLtGreenOnMagenta   = ƒ$5A;       ƒLtCyanOnMagenta    = ƒ$5B;
  87.              ƒLtGreenOnBrown     = ƒ$6A;       ƒLtCyanOnBrown      = ƒ$6B;
  88.              ƒLtGreenOnLtGray    = ƒ$7A;       ƒLtCyanOnLtGray     = ƒ$7B;
  89.  
  90. unit ƒShƒClrDef
  91.              {Light Red text}                {Light Magenta text}
  92.              ƒLtRedOnBlack       = ƒ$0C;       ƒLtMagentaOnBlack   = ƒ$0D;
  93.              ƒLtRedOnBlue        = ƒ$1C;       ƒLtMagentaOnBlue    = ƒ$1D;
  94.              ƒLtRedOnGreen       = ƒ$2C;       ƒLtMagentaOnGreen   = ƒ$2D;
  95.              ƒLtRedOnCyan        = ƒ$3C;       ƒLtMagentaOnCyan    = ƒ$3D;
  96.              ƒLtRedOnRed         = ƒ$4C;       ƒLtMagentaOnRed     = ƒ$4D;
  97.              ƒLtRedOnMagenta     = ƒ$5C;       ƒLtMagentaOnMagenta = ƒ$5D;
  98.              ƒLtRedOnBrown       = ƒ$6C;       ƒLtMagentaOnBrown   = ƒ$6D;
  99.              ƒLtRedOnLtGray      = ƒ$7C;       ƒLtMagentaOnLtGray  = ƒ$7D;
  100.  
  101. unit ƒShƒClrDef
  102.              {Yellow text}                   {White text}
  103.              ƒYellowOnBlack      = ƒ$0E;       ƒWhiteOnBlack       = ƒ$0F;
  104.              ƒYellowOnBlue       = ƒ$1E;       ƒWhiteOnBlue        = ƒ$1F;
  105.              ƒYellowOnGreen      = ƒ$2E;       ƒWhiteOnGreen       = ƒ$2F;
  106.              ƒYellowOnCyan       = ƒ$3E;       ƒWhiteOnCyan        = ƒ$3F;
  107.              ƒYellowOnRed        = ƒ$4E;       ƒWhiteOnRed         = ƒ$4F;
  108.              ƒYellowOnMagenta    = ƒ$5E;       ƒWhiteOnMagenta     = ƒ$5F;
  109.              ƒYellowOnBrown      = ƒ$6E;       ƒWhiteOnBrown       = ƒ$6F;
  110.              ƒYellowOnLtGray     = ƒ$7E;       ƒWhiteOnLtGray      = ƒ$7F;
  111.  
  112. unit ƒShƒClrDef
  113.              ƒOrientation = (ƒVertical, ƒHorizontal);
  114.  
  115. unit ƒShƒClrDef
  116.         ƒSELECTCOLORS
  117.         Declarations:
  118.              function SelectColors(Row, Col, BegAttr : byte;
  119.                               CpFrameChars      : FrameArray;
  120.                               Orient            : Orientation;
  121.                               ErasePanelOnExit,
  122.                               EraseCursorOnExit,
  123.                               WrapCursor        : boolean;
  124.                               Header  : string) : byte;
  125. .
  126.  
  127.         Purpose:
  128.              Displays a color selection panel, permitting the user to
  129.         move a special cursor using the arrow keys and select a desired
  130.         color combination using the <CR> key.
  131. .
  132.         Comments:
  133.              The user navigates the panel with the arrow keys and selects
  134.         the desired color combination by pressing <CR>. The attribute
  135.         byte value currently under the cursor will be returned. The user
  136.         can also press <INS>, which will return a function value of $FF,
  137.         and by convention, should be taken to indicate that the currently
  138.         selected attribute value is to be unchanged. Additionally, the
  139.         user can press <ESC>, returning a function value of $FE, which by
  140.         convention should be taken to indicate that the current color
  141.         selection run is completed. Finally, a return of $FD indicates
  142.         that the user has pressed the <F1> key either alone or in
  143.         combination with one of the shift-type keys (<L-SHIFT>, <R-
  144.         SHIFT>, <CTRL>, or <ALT>), and by convention indicates that the
  145.         user is requesting help.
  146. .
  147.              The function performs the following actions:
  148. .
  149.             *  Displays a 16x8 panel of text colors with the window
  150.                coordinates of the upper left corner at coordinates X=Col,
  151.                Y=Row.
  152. .
  153.             *  The attribute at which the cursor will be initially placed
  154.                is at BegAttr.
  155. .
  156.             *  The color panel will be framed using the characters
  157.                specified in CpFrameChars.
  158. .
  159.             *  The orientation of the long dimension of the selection
  160.                panel is determined as specified by Orient.
  161. .
  162.             *  ErasePanelOnExit determines whether the panel is erased or
  163.                preserved on the screen when SelectColors returns to the
  164.                caller. The panel is always disposed, and its heap space
  165.                reclaimed.
  166. .
  167.             *  EraseCursorOnExit is only effective if ErasePanelOnExit is
  168.                false. If the panel is to be preserved between calls to
  169.                SelectColors, EraseCursor determines whether the or not
  170.                the cursor will continue to be displayed along with the
  171.                panel.
  172. .
  173.             *  WrapCursor determines whether the cursor will wrap both
  174.                horizontally and vertically. True allows the cursor to
  175.                wrap; False inhibits further cursor movement when a window
  176.                edge is reached.
  177. .
  178.             *  Header is the header line which will be displayed on the
  179.                panel. It can be supplied as an empty string (''), in
  180.                which case no header will be displayed.
  181. .
  182.             *  The function returns a normal text attribute byte, with
  183.                the following exceptions:
  184. .
  185.                Return         Explanation
  186.                ------         -----------
  187.                $FF            <INS> was pressed by the user. Leave the
  188.                              current value unchanged.
  189.                $FE            <ESC> was pressed by the user. Accept all
  190.                              current values and consider the run
  191.                              completed.
  192.                $FD            <F1> was pressed by the user. Provide a
  193.                              HELP screen or message.
  194.                $F0            Error in MakeWindow
  195.                $F1            Error in DisplayWindow
  196.  
  197. unit ƒShƒClrDef
  198.         ƒCOLORNAME
  199.         Declarations:
  200.              function ColorName(Attr  : byte) : string;
  201. .
  202.         Purpose:
  203.              Given a text attribute byte, ColorName returns the attribute
  204.         color name as defined above; e.g., ColorName($1E) will return
  205.         'YellowOnBlue'.
  206. .
  207.         Comments:
  208.              If a byte value is passed which does not correspond to a
  209.         valid text attribute, an empty string is returned.
  210. .
  211.         Examples:
  212.         The statement
  213. .
  214.                              WriteLn(ColorName($73));
  215. .
  216.         displays the string
  217. .
  218.                                    CyanOnLtGray
  219. .
  220.         on the screen.
  221.  
  222. unit ƒShƒCmdLin
  223.              ƒValueType = (ƒVtStr, ƒVtReal, ƒVtInt);
  224.              ƒSwRec     = record
  225.                            ƒName  : string;
  226.                            case ƒSwVal  : ValueType of
  227.                              VtStr : (ƒStrVal : string);
  228.                              VtReal: (ƒRealVal: Extended);
  229.                              VtInt : (ƒIntVal : integer);
  230.                            end; {SwRec}
  231.              ƒCharSet = Set of Char;
  232.  
  233. unit ƒShƒCmdLin
  234.         ƒCLCLOSE
  235.         Declarations:
  236.              procedure ClClose;
  237. .
  238.         Purpose:
  239.              Closes the internal data structures and frees the space
  240.         associated with the command line switch list.
  241. .
  242.         Comments:
  243.              If GetSwitch is used to retrieve switch values, ClClose
  244.         should be called following retrieval of the last switch. If
  245.         PopSwitch is used, ClClose need not be called.
  246. .
  247.         Examples:
  248.              See the files TESTCL.PAS and CLTEST.BAT
  249. .
  250.         See also:
  251.              ClInit    GetSwitch      PopSwitch
  252.  
  253. unit ƒShƒCmdLin
  254.         ƒCLINIT
  255.         Declarations:
  256.              procedure ClInit;
  257. .
  258.         Purpose:
  259.              Initializes the internal data structures used to store the
  260.         command line switch list.
  261. .
  262.         Comments:
  263.              ClInit MUST be called prior to any of the other Cl routines.
  264. .
  265.         Examples:
  266.              See the files TESTCL.PAS and CLTEST.BAT
  267. .
  268.         See also:
  269.              ClClose
  270.  
  271. unit ƒShƒCmdLin
  272.         ƒCLPARSE
  273.         Declarations:
  274.              procedure ClParse(StrPtr : Pointer; StrOnly : Boolean;
  275.                       LeadIn, ValDelim : CharSet; var Err : Integer);
  276. .
  277.         Purpose:
  278.              To parse a command tail (or other string of similar form),
  279.         producing a list of switch names and associated values which can
  280.         then be retrieved using the GetSwitch or PopSwitch functions.
  281. .
  282.         Comments:
  283.              Parsing is accomplished by invoking the procedure ClParse
  284.         with five parameters:
  285. .
  286.            1.  StrPtr of type Pointer is used to point to the string to
  287.                be parsed. If StrPtr is NIL, the command tail will be
  288.                parsed.
  289. .
  290.            2.  StrOnly of type Boolean is used to determine if switch
  291.                values of type String are to be forced, regardless of the
  292.                form of the value. StrOnly = True forces String values.
  293. .
  294.            3.  LeadIn of type CharSet is used to identify the set of
  295.                characters used to mark the beginning of a switch. It is
  296.                suggested that LeadIn be set to [ ReadSwCh ]. The weakest
  297.                condition used should be that the expression ( ReadSwCh in
  298.                LeadIn ) be TRUE.
  299. .
  300.            4.  ValDelim of type CharSet is used to specify the set of
  301.                characters which may be used to separate the switch name
  302.                from the switch value.
  303. .
  304.            5.  Err of type Integer is used to return error conditions.
  305. .
  306.              Prior to the call to ClParse, a call MUST be made to ClInit.
  307. .
  308.              The procedure prepares a list of records, each record con-
  309.         taining the name and value of one command line switch. These
  310.         records will require 536 bytes of heap space per switch.
  311. .
  312.              All switches (with the optional exception of the first) are
  313.         preceded by one of the members of the set LeadIn.
  314. .
  315.              Switches may take values of type Real (actually, Extended),
  316.         LongInt, or String. In each case, the switch value is separated
  317.         from the switch name by one of the characters specified in the
  318.         parameter ValDelim. Switches which do not take on any explicit
  319.         value will be returned as type String, with a value length of
  320.         zero.
  321. .
  322.              Assuming StrOnly = FALSE in the call, switches whose VALUE
  323.         is intended to be of type String, but with a FORM qualifying as a
  324.         numeric, must be enclosed in either single or double quotation
  325.         marks. Otherwise, the value will be returned as a Real or
  326.         LongInt, as determined by its specific syntax.
  327. .
  328.              Additionally, any blanks included in String values will be
  329.         packed out unless the value is included in quotation marks.
  330.         Further, if single quote marks are to be included as part of a
  331.         string value, then double quotes must be used to define the
  332.         value; and vice versa.
  333. .
  334.              Finally, blanks may be freely entered in the command tail to
  335.         improve readability (except as noted above).
  336. .
  337.         Error Returns:
  338.              The error parameter returns one of three values:
  339.                   0 --> No error encountered.
  340.                   1 --> Unbalanced single quotes encountered.
  341.                   2 --> Unbalanced double quotes encountered.
  342.                   3 --> Insufficient heap space to store the switch list.
  343. .
  344.              Assuming the error return is 0, the list of switches has
  345.         been successfully prepared and is available for retrieval using
  346.         GetSwitch or PopSwitch.
  347. .
  348.              If GetSwitch has been used to retrieve the switch values,
  349.         ClClose should be called to release the heap space associated
  350.         with the list of switches. This is not necessary if PopSwitch has
  351.         been used for retrieval (but it won't hurt anything, either).
  352. .
  353.         Examples:
  354.              See the files TESTCL.PAS and CLTEST.BAT
  355. .
  356.         See also:
  357.              ClInit    ClClose   GetSwitch      PopSwitch
  358.  
  359. unit ƒShƒCmdLin
  360.         ƒGETSWITCH
  361.         Declarations:
  362.              function GetSwitch(var Y : SwRec) : boolean;
  363. .
  364.         Purpose:
  365.              Retrieves the next switch record in the list of switch
  366.         records prepared by ClParse. Returns FALSE if no more.
  367. .
  368.         Comments:
  369.              The list of switches can, if desired, be treated as a ring
  370.         (thus enabling switches to be read more than once). If GetSwitch
  371.         is called again after returning a function value of FALSE, read-
  372.         ing will recommence at the top of the list.
  373. .
  374.              Use of GetSwitch and PopSwitch should not be combined. If
  375.         they are both used on the same pass through the command tail,
  376.         orphan blocks (blocks which have no associated pointer, and thus
  377.         cannot be accessed or retrieved) will result on the heap.
  378. .
  379.         Examples:
  380.              See the files TESTCL.PAS and CLTEST.BAT
  381. .
  382.         See also:
  383.              PopSwitch
  384.  
  385. unit ƒShƒCmdLin
  386.         ƒPOPSWITCH
  387.         Declarations:
  388.              function PopSwitch(var Y : SwRec) : boolean;
  389. .
  390.         Purpose:
  391.              Retrieves the next switch record in the list of switch
  392.         records prepared by ClParse, and frees its heap space. Returns
  393.         FALSE if no more.
  394. .
  395.         Comments:
  396.              Since PopSwitch frees the heap space associated with each
  397.         switch after it has been returned to the caller, it is not
  398.         necessary to call ClClose after reaching the end of the switch
  399.         list. For the same reason, however, the switch list cannot be
  400.         treated as a ring (that is, the switch list cannot be reread
  401.         after the end has been reached).
  402. .
  403.              Use of GetSwitch and PopSwitch should not be combined. If
  404.         they are both used on the same pass through the command tail,
  405.         orphan blocks (blocks which have no associated pointer, and thus
  406.         cannot be accessed or retrieved) will result on the heap.
  407. .
  408.         Examples:
  409.              See the files TESTCL.PAS and CLTEST.BAT
  410. .
  411.         See also:
  412.              GetSwitch
  413.  
  414. unit ƒShƒCmdLin
  415.         ƒREADSWCH
  416.         Declarations:
  417.              function ReadSwCh : char;
  418. .
  419.         Purpose:
  420.              Returns the current switch lead-in character.
  421. .
  422.         Comments:
  423.              DOS normally recognizes the character '/' as the switch
  424.         lead-in. DOS also permits this character to be changed. In par-
  425.         ticular, some installations whose personnel are more comfortable
  426.         in a UNIX-like environment have changed the switch lead-in to
  427.         '-'. The ReadSwCh function permits the programmer to assure that
  428.         the character which DOS recognizes will be included in the set of
  429.         permissible lead-in characters which the parser will also
  430.         recognize.
  431. .
  432.         Examples:
  433.              See the files TESTCL.PAS and CLTEST.BAT
  434. .
  435.         See also:
  436.              SetSwCh
  437.  
  438. unit ƒShƒCmdLin
  439.         ƒSETSWCH
  440.         Declarations:
  441.              procedure SetSwCh(C : char);
  442. .
  443.         Purpose:
  444.              Sets the switch lead-in character to C.
  445. .
  446.         Comments:
  447.              THIS PROCEDURE MODIFIES THE CURRENTLY RUNNING COPY OF DOS.
  448.         Therefore it should only be used in exceptional circumstances,
  449.         and with great caution. Otherwise the users could be in for quite
  450.         a surprise! It is included here primarily for completeness.
  451. .
  452.         Examples:
  453.                                   SetSwCh('+');
  454. .
  455.         will change the switch lead-in to '+'.
  456. .
  457.         See also:
  458.              ReadSwCh
  459.  
  460. unit ƒShƒCmplx
  461.              ƒComplexElement  = extended;
  462.              ƒComplexBaseType = record
  463.                                  ƒRe,
  464.                                  ƒIm  : ComplexElement;
  465.                                  end;
  466.              ƒComplex         = ^ComplexBaseType;
  467.  
  468. unit ƒShƒCmplx
  469.         ƒC2P
  470.         Declarations:
  471.              procedure C2P(A : Complex; var Result : Complex);
  472.              function C2PF(A : Complex) : Complex;
  473. .
  474.         Purpose:
  475.              Transforms a complex in Cartesian form into polar form.
  476. .
  477.         Examples:
  478.              CpPwrR(C2PF(MyCmpx), 3.0, MyCmpxCubedPolar);
  479. .
  480.         Comments:
  481.              The magnitude will be stored in Result^.Re and the angle
  482.         (expressed in radians) in Result^.Im
  483. .
  484.         See Also:
  485.              P2C
  486.  
  487. unit ƒShƒCmplx
  488.         ƒCABS
  489.         Declarations:
  490.              procedure CAbs(A  : Complex; var Result : ComplexElement);
  491.              function CAbsF(A  : Complex)  : ComplexElement;
  492. .
  493.         Purpose:
  494.              Returns the absolute value of a complex number.
  495. .
  496.         Examples:
  497.              ∙∙∙
  498.              MyCmpx^.Re := 3.0;
  499.              MyCmpx^.Im := 4.0;
  500.              ∙∙∙
  501.              WriteLn(CAbs(MyCmpx):4:1);    {will display 5.0}
  502. .
  503.         Comments:
  504.              Recall that the absolute value of a complex number Re + iIm
  505.         is sqrt((Re * Re) + (Im * Im)).
  506. .
  507.         See Also:
  508.  
  509. unit ƒShƒCmplx
  510.         ƒCADD
  511.         Declarations:
  512.              procedure CAdd(A, B : Complex; var Result : Complex);
  513.              function CAddF(A, B : Complex) : Complex;
  514. .
  515.         Purpose:
  516.              Returns the sum of two complex numbers A + B.
  517. .
  518.         Examples:
  519.              See the file TESTCMPX.PAS
  520. .
  521.         Comments:
  522. .
  523.         See Also:
  524.              CSub      CMul      CDiv
  525.  
  526. unit ƒShƒCmplx
  527.         ƒCCONJ
  528.         Declarations:
  529.              procedure CConj(A : Complex; var Result : Complex);
  530.              function CConjF(A : Complex) : Complex;
  531. .
  532.         Purpose:
  533.              Returns the complex conjugate of a complex number.
  534. .
  535.         Examples:
  536.              See the file TESTCMPX.PAS
  537. .
  538.         Comments:
  539.              Recall that if a complex number A = R + Ii, then the complex
  540.         conjugate of A is R - Ii.
  541. .
  542.         See Also:
  543.  
  544. unit ƒShƒCmplx
  545.         ƒCDIV
  546.         Declarations:
  547.              procedure CDiv(A, B : Complex; var Result : Complex);
  548.              function CDivF(A, B : Complex) : Complex;
  549. .
  550.         Purpose:
  551.              Returns the quotient of two complex numbers A / B.
  552. .
  553.         Examples:
  554.              See the file TESTCMPX.PAS
  555. .
  556.         Comments:
  557.              CAbsF(B) must be > 0.0. If CAbsF(B) <= 0.0, CmplxError will
  558.         return -1.
  559. .
  560.         See Also:
  561.              CAdd      CMul      CSub
  562.  
  563. unit ƒShƒCmplx
  564.         ƒCMP2STR
  565.         Declarations:
  566.              function Cmp2Str(A : Complex; Width, Places : byte) :
  567.                                                                string;
  568. .
  569.         Purpose:
  570.              Converts a complex value to a string of the form
  571.                                    (Re + Im i)
  572. .
  573.         Examples:
  574.              See the file TESTCMPX.PAS
  575. .
  576.         Comments:
  577.              The Width and Places arguments have the same significance
  578.         that they do in the system procedure STR, and are applied
  579.         individually to both the REAL and IMAGINARY parts.
  580. .
  581.         See Also:
  582.              CmpP2Str       CmpP2StrD
  583.  
  584. unit ƒShƒCmplx
  585.         ƒCMPLXERROR
  586.         Declarations:
  587.              function CmplxError  : integer;
  588. .
  589.         Purpose:
  590.              Returns execution error conditions for the package.
  591. .
  592.         Examples:
  593.              See the file TESTCMPX.PAS
  594. .
  595.         Comments:
  596.              Return = 0     OK
  597.                       -1    Attempt to divide by zero (CDiv)
  598.                       -2    Magnitude of complex is zero (CpPwrR)
  599. .
  600.         See Also:
  601.  
  602. unit ƒShƒCmplx
  603.         ƒCMPP2STR
  604.         Declarations:
  605.              function CmpP2Str(A : Complex; Width, Places : byte) :
  606.                                                                string;
  607. .
  608.         Purpose:
  609.              Converts a complex in polar form to a string with the angle
  610.         expressed in radians.
  611. .
  612.         Examples:
  613.              See the file TESTCMPX.PAS
  614. .
  615.         Comments:
  616.              The Width and Places arguments have the same significance
  617.         that they do in the system procedure STR, and are applied
  618.         individually to both the MAGNITUDE and ANGLE parts.
  619. .
  620.         See Also:
  621.              Cmp2Str        CmpP2StrD
  622.  
  623. unit ƒShƒCmplx
  624.         ƒCMPP2STRD
  625.         Declarations:
  626.              function CmpP2StrD(A : Complex; Width, Places : byte) :
  627.                                                                string;
  628. .
  629.         Purpose:
  630.              Converts a complex in polar form to a string with the angle
  631.         in degrees.
  632. .
  633.         Examples:
  634.              See the file TESTCMPX.PAS
  635. .
  636.         Comments:
  637.              The Width and Places arguments have the same significance
  638.         that they do in the system procedure STR, and are applied
  639.         individually to both the MAGNITUDE and ANGLE parts.
  640. .
  641.         See Also:
  642.              Cmp2Str        CmpP2Str
  643.  
  644. unit ƒShƒCmplx
  645.         ƒCMUL
  646.         Declarations:
  647.              procedure CMul(A, B : Complex; var Result : Complex);
  648.              function CMulF(A, B : Complex) : Complex;
  649. .
  650.         Purpose:
  651.              Returns the product of two complex numbers A * B.
  652. .
  653.         Examples:
  654.              See the file TESTCMPX.PAS
  655. .
  656.         Comments:
  657. .
  658.         See Also:
  659.              CAdd      CDiv      CSub      RxC
  660.  
  661. unit ƒShƒCmplx
  662.         ƒCPPWRR
  663.         Declarations:
  664.              procedure CpPwrR(A : Complex; R : ComplexElement;
  665.                                                 var Result : Complex);
  666.              function CpPwrRF(A : Complex; R : ComplexElement) : Complex;
  667. .
  668.         Purpose:
  669.              Raises a complex (in polar form) to a real power.
  670. .
  671.         Examples:
  672.              See the file TESTCMPX.PAS
  673. .
  674.         Comments:
  675.              If A^.Re = 0, CmplxError will return -2, and
  676.                            Result will be 0 + 0i
  677.                            n.b. A^.Re contains the magnitude.
  678. .
  679.         See Also:
  680.  
  681. unit ƒShƒCmplx
  682.         ƒCSUB
  683.         Declarations:
  684.              procedure CSub(A, B : Complex; var Result : Complex);
  685.              function CSubF(A, B : Complex) : Complex;
  686. .
  687.         Purpose:
  688.              Returns the difference between two complex numbers A - B.
  689. .
  690.         Examples:
  691.              See the file TESTCMPX.PAS
  692. .
  693.         Comments:
  694. .
  695.         See Also:
  696.              CAdd      CDiv      CMul
  697.  
  698. unit ƒShƒCmplx
  699.         ƒP2C
  700.         Declarations:
  701.              procedure P2C(A : Complex; var Result : Complex);
  702.              function P2CF(A : Complex) : Complex;
  703. .
  704.         Purpose:
  705.              Transforms a complex in polar form into Cartesian form. The
  706.         magnitude is stored in A^.Re and the angle (expressed in radians)
  707.         in A^.Im.
  708. .
  709.         Examples:
  710.              See the file TESTCMPX.PAS
  711. .
  712.         Comments:
  713. .
  714.         See Also:
  715.              C2P
  716.  
  717. unit ƒShƒCmplx
  718.         ƒRXC
  719.         Declarations:
  720.              procedure RxC(A : ComplexElement; B : Complex;
  721.                                                 var Result : Complex);
  722.              function RxCF(A : ComplexElement; B : Complex) : Complex;
  723. .
  724.         Purpose:
  725.              Returns the complex product of a real and a complex.
  726. .
  727.         Examples:
  728.              See the file TESTCMPX.PAS
  729. .
  730.         Comments:
  731.              This is simply a special case of CMul, in which the
  732.         imaginary part of one of the factors is zero. It occurrs with
  733.         sufficient frequency, however, to warrent separate treatment.
  734. .
  735.         See Also:
  736.              CMul
  737.  
  738. unit ƒShƒCrcChk
  739.         ƒCRCCALC
  740.         Declarations:
  741.              function CrcCalc(FileName : String) : word;
  742. .
  743.         Purpose:
  744.               To calculate the CRC16 of a named file, assumed to exist.
  745. .
  746.         Examples:
  747.               if CrcCalc(MyFile) <> CrcShouldBe then begin
  748.                 (*Take remedial action*)
  749.                 end;
  750. .
  751.         Comments:
  752.               MyFile is a file of any type, and may have any attributes
  753.         including Hidden, ReadOnly, etc. A run time error will result,
  754.         however, if the file does not exist.
  755.  
  756. unit ƒShƒCrcChk
  757.         ƒCRCCOPY
  758.         Declarations:
  759.              function CrcCopy(InFileName, OutFileName : String) : word;
  760. .
  761.         Purpose:
  762.               Calculates the CRC16 value for file=InFileName, while
  763.         copying it to file=OutFileName.
  764. .
  765.         Examples:
  766.               CrcShouldBe := CrcCopy(FileFromYou, MyFile);
  767.               if CrcCopy(MyFile, '') <> CrcShouldBe then begin
  768.                 (*Take remedial action*)
  769.                 end;
  770. .
  771.         Comments:
  772.               The output file name is optional. If OutFileName is speci-
  773.         fied, InFileName is copied to OutFileName. If OutFileName is an
  774.         empty string, CrcCopy behaves exactly like CrcCalc. In either
  775.         case, the CRC16 value of InFileName is returned.
  776. .
  777.               Using CrcCopy simply to calculate the CRC16 of the input
  778.         file will be marginally slower than using CrcCalc. In cases in
  779.         which both functionalities are required, however, using CrcCopy
  780.         exclusively will result in a somewhat smaller code segment.
  781.  
  782. unit ƒShƒDatPk
  783.              ƒGregType  = record
  784.                            ƒYear  : LongInt;
  785.                            ƒMonth,
  786.                            ƒDay   : byte;
  787.                            end;
  788.              Variables of this type contain a complete Gregorian date,
  789.         and are passed to many of the routines in this unit.
  790. .
  791.              ƒTimeType  = record
  792.                            ƒH,
  793.                            ƒM,
  794.                            ƒS   : byte;
  795.                            end;
  796.              Variables of this type contain a complete time record, and
  797.         are passed to many of the routines in this unit.
  798.  
  799. unit ƒShƒDatPk
  800.              ƒDayStr  : array[0..6] of string[9] =
  801.                            ('Sunday'   , 'Monday'   , 'Tuesday'  ,
  802.                             'Wednesday', 'Thursday' , 'Friday'   ,
  803.                             'Saturday' );
  804.  
  805. unit ƒShƒDatPk
  806.              ƒMonthStr: array[1..12] of string[9] =
  807.                            ('January'  , 'February' , 'March',
  808.                             'April'    , 'May'      , 'June',
  809.                             'July'     , 'August'   , 'September',
  810.                             'October'  , 'November' , 'December');
  811.  
  812. unit ƒShƒDatPk
  813.         ƒDOW
  814.         Declarations:
  815.              function DoW(Greg : GregType) : byte;
  816. .
  817.         Purpose:
  818.              To compute the day of the week (Sunday = 0; Saturday = 6)
  819.         from the Gregorian date.
  820. .
  821.         Examples:
  822.              See TESTDATE.PAS
  823. .
  824.         Comments:
  825. .
  826.         See also:
  827.  
  828. unit ƒShƒDatPk
  829.         ƒGREG2ANSI
  830.         Declarations:
  831.              function Greg2ANSI(G : GregType) : string;
  832. .
  833.         Purpose:
  834.              Given a Gregorian date, return the date as an ANSI date
  835.         string (YYYYMMDD).
  836. .
  837.         Examples:
  838.              See TESTDATE.PAS
  839. .
  840.         Comments:
  841.              Note that the ANSI date format is both sortable and
  842.         readable.
  843. .
  844.         See also:
  845.              JDN2ANSI
  846.  
  847. unit ƒShƒDatPk
  848.         ƒGREG2JDATE
  849.         Declarations:
  850.              function Greg2JDate(Greg : GregType) : integer;
  851. .
  852.         Purpose:
  853.              To compute the Julian date from the Gregorian date.
  854. .
  855.         Examples:
  856.              See TESTDATE.PAS
  857. .
  858.         Comments:
  859.              Do not confuse the Julian date with the Julian Day-Number.
  860.         The Julian date, most commonly used in business applications, is
  861.         the serial index of a date WITHIN A GIVEN YEAR. The Julian Day-
  862.         Number is the serial index of a date from January 1, 4713 B.C.
  863. .
  864.         See also:
  865.              JDate2Greg
  866.  
  867. unit ƒShƒDatPk
  868.         ƒGREG2JDN
  869.         Declarations:
  870.              function Greg2JDN(Greg : GregType) : LongInt;
  871. .
  872.         Purpose:
  873.              To convert a Gregorian date into a Julian Day-Number.
  874. .
  875.         Examples:
  876.              See TESTDATE.PAS
  877. .
  878.         Comments:
  879.              The Julian Day-Number (JDN) is the basic form for date
  880.         manipulation within this unit. Thus this function performs the
  881.         primary conversion between dates in the customary form and
  882.         equivalent dates suitable for manipulation by ShDatPk.
  883. .
  884.         See also:
  885.              JDN2Greg
  886.  
  887. unit ƒShƒDatPk
  888.         ƒJDATE2GREG
  889.         Declarations:
  890.              procedure JDate2Greg(JDate, Year : Integer;
  891.                                                     var Greg : GregType);
  892. .
  893.         Purpose:
  894.              To compute the Gregorian date from the Julian date.
  895. .
  896.         Examples:
  897.              See TESTDATE.PAS
  898. .
  899.         Comments:
  900.              Do not confuse the Julian date with the Julian Day-Number.
  901.         The Julian date, most commonly used in business applications, is
  902.         the serial index of a date WITHIN A GIVEN YEAR. The Julian Day-
  903.         Number is the serial index of a date from January 1, 4713 B.C.
  904. .
  905.         See also:
  906.              Greg2JDate
  907.  
  908. unit ƒShƒDatPk
  909.         ƒJDN2ANSI
  910.         Declarations:
  911.              function JDN2ANSI(JDN : LongInt) : string;
  912. .
  913.         Purpose:
  914.              Given a Julian Day-Number, return the JDN as an ANSI date
  915.         string (YYYYMMDD).
  916. .
  917.         Examples:
  918.              See TESTDATE.PAS
  919. .
  920.         Comments:
  921.              Note that the ANSI date format is both sortable and
  922.         readable.
  923. .
  924.         See also:
  925.              Greg2ANSI
  926.  
  927. unit ƒShƒDatPk
  928.         ƒJDN2GREG
  929.         Declarations:
  930.              procedure JDN2Greg(JDN : LongInt; var Greg : GregType);
  931. .
  932.         Purpose:
  933.              To compute the Gregorian date from the Julian Day-Number.
  934. .
  935.         Examples:
  936.              See TESTDATE.PAS
  937. .
  938.         Comments:
  939.              The Julian Day-Number (JDN) is the basic form for date
  940.         manipulation within this unit. Thus this function performs the
  941.         primary conversion between dates in ShDatPk internal form and
  942.         equivalent dates in the customary form.
  943. .
  944.         See also:
  945.              Greg2JDN
  946.  
  947. unit ƒShƒDatPk
  948.         ƒGREG2STR
  949.         Declarations:
  950.              function Greg2Str(G : GregType; Delim : string) : string;
  951. .
  952.         Purpose:
  953.              Returns a Gregorian date record as a string of the form
  954.         MMdDDdYYYY, where the separator, "d", is Delim[1].
  955. .
  956.         Examples:
  957.              See TESTDATE.PAS
  958. .
  959.         Comments:
  960. .
  961.         See also:
  962.  
  963. unit ƒShƒDatPk
  964.         ƒJDN2STR
  965.         Declarations:
  966.              function JDN2Str(JDN : LongInt; Delim : string) : string;
  967. .
  968.         Purpose:
  969.              Returns a Julian Day-Number as a string of the form
  970.         MMdDDdYYYY, where the separator, "d", is Delim[1].
  971. .
  972.         Examples:
  973.              See TESTDATE.PAS
  974. .
  975.         Comments:
  976. .
  977.         See also:
  978.  
  979. unit ƒShƒDatPk
  980.         ƒNOW
  981.         Declarations:
  982.              function Now  : LongInt;
  983. .
  984.         Purpose:
  985.              Returns the system time as Seconds-Since-Midnight.
  986. .
  987.         Examples:
  988.              See TESTDATE.PAS
  989. .
  990.         Comments:
  991. .
  992.         See also:
  993.  
  994. unit ƒShƒDatPk
  995.         ƒNOW2TIME
  996.         Declarations:
  997.              procedure Now2Time(var T : TimeType);
  998. .
  999.         Purpose:
  1000.              Returns the system time as a Time record.
  1001. .
  1002.         Examples:
  1003.              See TESTDATE.PAS
  1004. .
  1005.         Comments:
  1006. .
  1007.         See also:
  1008.  
  1009. unit ƒShƒDatPk
  1010.         ƒNOWSTR
  1011.         Declarations:
  1012.              function NowStr(Delim : string; T24 : boolean) : string;
  1013. .
  1014.         Purpose:
  1015.              Returns the system time as a string of the form:
  1016. .
  1017.              HHdMMdSSss     if Delim is non-empty and T24 (24 hour time)
  1018.                            is false. The delimiter used, "d", is
  1019.                            Delim[1]. The suffix, "ss", is "am" or "pm" as
  1020.                            appropriate.
  1021.              HHdMMdSS       if Delim is non-empty and T24 (24 hour time)
  1022.                            is true. The delimiter used, "d", is Delim[1].
  1023.                            The time will be expressed in 24-hour form.
  1024.              HHMMSSss       if Delim is empty and T24 (24 hour time) is
  1025.                            false. The suffix, "ss", is "am" or "pm" as
  1026.                            appropriate.
  1027.              HHMM           if Delim is empty and T24 (24 hour time) is
  1028.                            true. The time will be expressed in 24-hour
  1029.                            form.
  1030. .
  1031.         Examples:
  1032.              See TESTDATE.PAS
  1033. .
  1034.         Comments:
  1035. .
  1036.         See also:
  1037.  
  1038. unit ƒShƒDatPk
  1039.         ƒSSM2TIME
  1040.         Declarations:
  1041.              procedure SSM2Time(SSM : LongInt; var T : TimeType);
  1042. .
  1043.         Purpose:
  1044.              Converts Seconds-Since-Midnight to a Time record.
  1045. .
  1046.         Examples:
  1047.              See TESTDATE.PAS
  1048. .
  1049.         Comments:
  1050. .
  1051.         See also:
  1052.  
  1053. unit ƒShƒDatPk
  1054.         ƒSSM2TIMESTR
  1055.         Declarations:
  1056.              function SSM2TimeStr(SSM : LongInt; Delim : string;
  1057.                                                  T24 : boolean) : string;
  1058. .
  1059.         Purpose:
  1060.              Converts Seconds-Since-Midnight to a time string, of the
  1061.         form:
  1062. .
  1063.              HHdMMdSSss     if Delim is non-empty and T24 (24 hour time)
  1064.                            is false. The delimiter used, "d", is
  1065.                            Delim[1]. The suffix, "ss", is "am" or "pm" as
  1066.                            appropriate.
  1067.              HHdMMdSS       if Delim is non-empty and T24 (24 hour time)
  1068.                            is true. The delimiter used, "d", is Delim[1].
  1069.                            The time will be expressed in 24-hour form.
  1070.              HHMMSSss       if Delim is empty and T24 (24 hour time) is
  1071.                            false. The suffix, "ss", is "am" or "pm" as
  1072.                            appropriate.
  1073.              HHMM           if Delim is empty and T24 (24 hour time) is
  1074.                            true. The time will be expressed in 24-hour
  1075.                            form.
  1076. .
  1077.         Examples:
  1078.              See TESTDATE.PAS
  1079. .
  1080.         Comments:
  1081. .
  1082.         See also:
  1083.  
  1084. unit ƒShƒDatPk
  1085.         TIME2SSM
  1086.         Declaration
  1087.              function Time2SSM(T : TimeType) : LongInt;
  1088. .
  1089.         Purpose:
  1090.              Converts a Time record to Seconds-Since-Midnight.
  1091. .
  1092.         Examples:
  1093.              See TESTDATE.PAS
  1094. .
  1095.         Comments:
  1096. .
  1097.         See also:
  1098.  
  1099. unit ƒShƒDatPk
  1100.         ƒTIME2TIMESTR
  1101.         Declarations:
  1102.              function Time2TimeStr(T : TimeType; Delim : string;
  1103.                                                  T24 : boolean) : string;
  1104. .
  1105.         Purpose:
  1106.              Converts a time record to a time string of the form:
  1107. .
  1108.              HHdMMdSSss     if Delim is non-empty and T24 (24 hour time)
  1109.                            is false. The delimiter used, "d", is
  1110.                            Delim[1]. The suffix, "ss", is "am" or "pm" as
  1111.                            appropriate.
  1112.              HHdMMdSS       if Delim is non-empty and T24 (24 hour time)
  1113.                            is true. The delimiter used, "d", is Delim[1].
  1114.                            The time will be expressed in 24-hour form.
  1115.              HHMMSSss       if Delim is empty and T24 (24 hour time) is
  1116.                            false. The suffix, "ss", is "am" or "pm" as
  1117.                            appropriate.
  1118.              HHMM           if Delim is empty and T24 (24 hour time) is
  1119.                            true. The time will be expressed in 24-hour
  1120.                            form.
  1121. .
  1122.         Examples:
  1123.              See TESTDATE.PAS
  1124. .
  1125.         Comments:
  1126. .
  1127.         See also:
  1128.  
  1129. unit ƒShƒDatPk
  1130.         ƒTODAY
  1131.         Declarations:
  1132.              function Today  : LongInt;
  1133. .
  1134.         Purpose:
  1135.              Returns the system date as a Julian Day-Number.
  1136. .
  1137.         Examples:
  1138.              See TESTDATE.PAS
  1139. .
  1140.         Comments:
  1141. .
  1142.         See also:
  1143.  
  1144. unit ƒShƒDatPk
  1145.         ƒTODAY2ANSI
  1146.         Declarations:
  1147.              function Today2ANSI : string;
  1148. .
  1149.         Purpose:
  1150.              Returns the system date as an ANSI date string (YYYYMMDD).
  1151. .
  1152.         Examples:
  1153.              See TESTDATE.PAS
  1154. .
  1155.         Comments:
  1156.              Note that the ANSI date format is both sortable and
  1157.         readable.
  1158. .
  1159.         See also:
  1160.  
  1161. unit ƒShƒDatPk
  1162.         ƒTODAY2GREG
  1163.         Declarations:
  1164.              procedure Today2Greg(var G : GregType);
  1165. .
  1166.         Purpose:
  1167.              Returns the system date as a Gregorian date record.
  1168. .
  1169.         Examples:
  1170.              See TESTDATE.PAS
  1171. .
  1172.         Comments:
  1173. .
  1174.         See also:
  1175.  
  1176. unit ƒShƒDatPk
  1177.         ƒTODAYSTR
  1178.         Declarations:
  1179.              function TodayStr(Delim : string) : string;
  1180. .
  1181.         Purpose:
  1182.              Returns the system date as a string of the form MMdDDdYYYY,
  1183.         where the separator, "d", is Delim[1].}
  1184. .
  1185.         Examples:
  1186.              See TESTDATE.PAS
  1187. .
  1188.         Comments:
  1189. .
  1190.         See also:
  1191.  
  1192. unit ƒShƒErrMsg
  1193.         CHECKON
  1194.         ƒCHECKOFF
  1195.         Declarations:
  1196.              procedure CheckOn;
  1197.              procedure CheckOff;
  1198. .
  1199.         Purpose:
  1200.              Enables/disables the error reporting facilities of ShErrMsg.
  1201. .
  1202.         Examples:
  1203.              ∙∙∙
  1204.              CheckOff; {Turn off error reporting}
  1205.              ∙∙∙
  1206.              CheckOn;  {Turn error reporting back on}
  1207. .
  1208.         Comments:
  1209.              The default state following initialization is CheckOn.
  1210.  
  1211. unit ƒShƒErrMsg
  1212.         ƒHALTMSG
  1213.         Declarations:
  1214.              procedure HaltMsg(Code : word; Msg : string);
  1215. .
  1216.         Purpose:
  1217.              To stop execution of the program, returning an error code to
  1218.         DOS and optionally displaying a message.
  1219. .
  1220.         Examples:
  1221.              ∙∙∙
  1222.              HaltMsg(1000, 'Exiting on a problem in procedure FOO_BAZ');
  1223. .
  1224.         Comments:
  1225.              If Checking is ON, execution will stop with the message, and
  1226.         a return code of 1000 will be passed to DOS.
  1227. .
  1228.                     ErrorLevel 1000
  1229.                        Exiting on a problem in procedure FOO_BAZ
  1230. .
  1231.              If checking is OFF, execution will stop with no message, and
  1232.         a return code of 1000 will be passed to DOS.
  1233. .
  1234.              In either case, due to the way in which DOS is implemented,
  1235.         an
  1236. .
  1237.                                   IF ERRORLEVEL
  1238. .
  1239.         command will be sensitive ONLY TO THE LOW BYTE of the code. Thus,
  1240.         in the above example, DOS will see a return code of 232.
  1241. .
  1242.         See also:
  1243.              RunErrorMsg
  1244.  
  1245. unit ƒShƒErrMsg
  1246.         ƒRUNERRORMSG
  1247.         Declarations:
  1248.              procedure RunErrorMsg(Code : integer; Msg : string);
  1249. .
  1250.         Purpose:
  1251.              To stop execution of the program with a runtime error
  1252.         message, optionally augmented by an additional information
  1253.         message, and returning an error code to DOS.
  1254. .
  1255.         Examples:
  1256.              ∙∙∙
  1257.              RunErrorMsg(1000, 'Problem in procedure FOO_BAZ');
  1258. .
  1259.         Comments:
  1260.              If Checking is ON, execution will stop with the following
  1261.         message, and a return code of 1000 will be passed to DOS.
  1262. .
  1263.                            Runtime error 1000 at 0C8F:0008
  1264.                               Problem in procedure FOO_BAZ
  1265. .
  1266.              If checking is OFF, execution will stop with the following
  1267.         message, and a return code of 1000 will be passed to DOS.
  1268. .
  1269.                            Runtime error 232 at 0000:C8F8
  1270. .
  1271.              In either case, due to the way in which DOS is implemented,
  1272.         an
  1273. .
  1274.                                   IF ERRORLEVEL
  1275. .
  1276.         command will be sensitive ONLY TO THE LOW BYTE of the code. Thus,
  1277.         in the above example, DOS will see a return code of 232.
  1278. .
  1279.              Note also that, if checking if turned off, the error address
  1280.         is not normalized.
  1281. .
  1282.         See also:
  1283.              HaltMsg
  1284.  
  1285. unit ƒShƒFinanc
  1286.         Types
  1287.         =====
  1288.              AnnType   = (Ordinary, Due);
  1289.  
  1290. unit ƒShƒFinanc
  1291.         Constants
  1292.         =========
  1293.              ƒfinƒOK                     = 0;
  1294.              ƒfinƒErrParamTooSmall       = 200;
  1295.              ƒfinƒIntOutOfRange          = 201;
  1296.              ƒfinƒIllegalNumPeriods      = 202;
  1297.              ƒfinƒUnknownAnnuityType     = 203;
  1298.              ƒfinƒIllegalPresentValue    = 204;
  1299.              ƒfinƒ80x87error             = 205;
  1300.              ƒfinƒNoConvergence          = 206;
  1301.              ƒfinƒIndeterminateForm      = 207;
  1302. .
  1303.              {ƒ80x87 errors}
  1304.              ƒfinƒInvalidOperation       =  1;
  1305.              ƒfinƒDenormalizedOperand    =  2;
  1306.              ƒfinƒDivideByZero           =  4;
  1307.              ƒfinƒOverflow               =  8;
  1308.              ƒfinƒUnderflow              = 16;
  1309. .
  1310.              FW  = 17;
  1311.              DP  = 10;
  1312.              IW  =  6;
  1313.  
  1314. unit ƒShƒFinanc
  1315.         Variables
  1316.         =========
  1317.              ƒfinƒError,
  1318.              ƒfinƒ87error  : word;
  1319.  
  1320.         Routines
  1321.         ========
  1322.  
  1323. unit ƒShƒFinanc
  1324.         ____________________________
  1325.         ƒANNUITYAMOUNT
  1326. .
  1327.         Declaration:
  1328.              function AnnuityAmount(N : integer;
  1329.                                      I : extended;
  1330.                                      AType : AnnType) : extended;
  1331. .
  1332.         Purpose:
  1333.              To calculate the annuity amount of 1 for N periods at an
  1334.         interest rate of I.
  1335. .
  1336.         Examples:
  1337. .
  1338.         Comments:
  1339.              The annuity may be either ordinary or due, depending on the
  1340.         value of AType.
  1341. .
  1342.         See also:
  1343.              AnnuityPresVal      NumPay         IfromPresVal
  1344.  
  1345. unit ƒShƒFinanc
  1346.         ____________________________
  1347.         ƒANNUITYPRESVAL
  1348. .
  1349.         Declaration:
  1350.              function AnnuityPresVal(N : integer;
  1351.                                      I : extended;
  1352.                                      AType : AnnType) : extended;
  1353. .
  1354.         Purpose:
  1355.              To calculate the annuity present value of 1 for N periods at
  1356.         an interest rate of I.
  1357. .
  1358.         Examples:
  1359. .
  1360.         Comments:
  1361.              The annuity may be either ordinary or due, depending on the
  1362.         value of AType.
  1363. .
  1364.         See also:
  1365.              AnnuityAmount       NumPay         IfromPresVal
  1366.  
  1367.  
  1368. unit ƒShƒFinanc
  1369.         ____________________________
  1370.         ƒCOMPAMOUNT
  1371. .
  1372.         Declaration:
  1373.              function CompAmount(N : integer; I : extended;) : extended;
  1374. .
  1375.         Purpose:
  1376.              To calculate the compound amount of 1 for N periods at an
  1377.         interest rate of I.
  1378. .
  1379.         Examples:
  1380. .
  1381.         Comments:
  1382. .
  1383.         See also:
  1384.              CompPresVal
  1385.  
  1386. unit ƒShƒFinanc
  1387.         ____________________________
  1388.         ƒCOMPPRESVAL
  1389. .
  1390.         Declaration:
  1391.              function CompPresVal(N : integer; I : extended;) : extended;
  1392. .
  1393.         Purpose:
  1394.              To calculate the compound present value of 1 for N periods
  1395.         at an interest rate of I.
  1396. .
  1397.         Examples:
  1398. .
  1399.         Comments:
  1400. .
  1401.         See also:
  1402.              CompAmount
  1403. .
  1404.  
  1405. unit ƒShƒFinanc
  1406.         ____________________________
  1407.         ƒFIN87ERRCODE
  1408. .
  1409.         Declaration:
  1410.              function fin87errCode : word;
  1411. .
  1412.         Purpose:
  1413.              If finErrCheckOff has been turned off and if finErrCode =
  1414.         fin80x87error, then fin87errCode will return the 80x87 error code
  1415.         resulting from the last call to a financial routine, and will
  1416.         reset the internal 80x87 error variable to 0 (finOK).
  1417. .
  1418.         Examples:
  1419. .
  1420.         Comments:
  1421.              fin87errCode should be called whenever a call to finErrCode
  1422.         returns a value of fin80x87error.
  1423. .
  1424.         See also:
  1425.              finErrChkOff   finErrCheckOn       finErrCode
  1426.              finErrMsg
  1427.  
  1428. unit ƒShƒFinanc
  1429.         ____________________________
  1430.         ƒFINERRCHECKON
  1431. .
  1432.         Declaration:
  1433.              procedure finErrCheckOn;
  1434. .
  1435.         Purpose:
  1436.              To turn error checking ON within the shFinanc unit.
  1437. .
  1438.         Examples:
  1439. .
  1440.         Comments:
  1441.              Following a call to finErrCheckOn, any errors occurring in
  1442.         any of the routines of shFinanc will cause program termination
  1443.         with an appropriate error message.
  1444. .
  1445.              The default value is ON.
  1446. .
  1447.         See also:
  1448.              fin87ErrCode   finErrCheckOff      finErrCode
  1449.              finErrMsg
  1450.  
  1451.  
  1452. unit ƒShƒFinanc
  1453.         ____________________________
  1454.         ƒFINERRCHECKOFF
  1455. .
  1456.         Declaration:
  1457.              procedure finErrCheckOff;
  1458. .
  1459.         Purpose:
  1460.              To turn error checking OFF within the shFinanc unit.
  1461. .
  1462.         Examples:
  1463. .
  1464.         Comments:
  1465.              Following a call to finErrCheckOff, any errors occurring in
  1466.         any of the routines of shFinanc will not cause program
  1467.         termination, but any error will be available through a call to
  1468.         finErrCode and the corresponding message will be available
  1469.         through a call to finErrMsg.
  1470. .
  1471.              The default value is ON.
  1472. .
  1473.         See also:
  1474.              fin87ErrCode   finErrCheckOn       finErrCode
  1475.              finErrMsg
  1476.  
  1477. unit ƒShƒFinanc
  1478.         ____________________________
  1479.         ƒFINERRCODE
  1480. .
  1481.         Declaration:
  1482.              function finErrCode : word;
  1483. .
  1484.         Purpose:
  1485.              If finErrCheckOff has been turned off, finErrCode will re-
  1486.         turn the error code resulting from the last call to a financial
  1487.         routine, and will reset the internal error variable to 0 (finOK).
  1488. .
  1489.         Examples:
  1490. .
  1491.         Comments:
  1492.              As with the Turbo Pascal function IoResult, finErrCode
  1493.         should be called after each call to a financial routine.
  1494. .
  1495.         See also:
  1496.              fin87ErrCode   finErrChkOff   finErrCheckOn
  1497.              finErrMsg
  1498.  
  1499.  
  1500. unit ƒShƒFinanc
  1501.         ____________________________
  1502.         ƒFINERRMSG
  1503. .
  1504.         Declaration:
  1505.              function finErrMsg(Code : word) : string;
  1506. .
  1507.         Purpose:
  1508.              To return the message corresponding to a given error code.
  1509. .
  1510.         Examples:
  1511.              The code
  1512.                        APV := AnnuityPresentValue(100, -0.95, Ordinary);
  1513.                        S := finErrMsg(finErrCode);
  1514.         will result in S conatining the string
  1515. .
  1516.                        'Interest parameter out of range.'
  1517. .
  1518.         Comments:
  1519. .
  1520.         See also:
  1521.              fin87errCode   finErrChkOff   finErrCheckOn
  1522.              finErrCode
  1523.  
  1524. unit ƒShƒFinanc
  1525.         ____________________________
  1526.         ƒIFROMPRESVAL
  1527. .
  1528.         Declaration:
  1529.              function IfromPresVal(PresVal : extended;
  1530.                                    N       : integer;
  1531.                                    AType   : AnnType;
  1532.                                    Err     : extended) : extended;
  1533. .
  1534.         Purpose:
  1535.              To calculate the interest rate of an annuity of 1 whose
  1536.         present value is PresVal for N payments.
  1537. .
  1538.         Examples:
  1539. .
  1540.         Comments:
  1541.              The annuity may be either ordinary or due, depending on the
  1542.         value of AType.
  1543. .
  1544.              Err is the maximum allowable absolute error of calculation.
  1545.         If the unit is compiled with {$N+}, then Err must be >= 1.0E-16.
  1546.         If compiled with {$N-}, then Err must be >= 1.0E-9.
  1547. .
  1548.         See also:
  1549.  
  1550.  
  1551. unit ƒShƒFinanc
  1552.         ____________________________
  1553.         ƒNUMPAY
  1554.  
  1555.         Declaration:
  1556.              function NumPay(PresVal,
  1557.                              I     :  extended;
  1558.                              AType :  AnnType) : integer;
  1559. .
  1560.         Purpose:
  1561.              To calculate the number of periods needed to retire a mort-
  1562.         gage of 1 whose present value is PresVal at an interest rate of I
  1563.         per period.
  1564. .
  1565.         Examples:
  1566. .
  1567.         Comments:
  1568.              The annuity may be either ordinary or due, depending on the
  1569.         value of AType.
  1570. .
  1571.         See also:
  1572.              AnnuityPresVal      IfromPresVal
  1573.  
  1574. unit ƒShƒList
  1575.              ƒslƒNodePtr = ^slNode;
  1576.              ƒslƒNode    = record
  1577.                            ƒData  : pointer;
  1578.                            ƒNext  : slNodePtr;
  1579.                            end;
  1580.              ƒdlƒNodePtr = ^dlNode;
  1581.              ƒdlƒNode    = record
  1582.                            Data  : pointer;
  1583.                            Next,
  1584.                            ƒPrev  : dlNodePtr;
  1585.                            end;
  1586.              These are the basic node structures of the nodes for singly
  1587.         and doubly linked nodes. They will be of no particular interest
  1588.         to you unless you need to modify the code of the unit.
  1589.  
  1590. unit ƒShƒList
  1591.              ƒslƒList    = record
  1592.                            ƒDataRecSize : word;
  1593.                            ƒCount       : LongInt;
  1594.                            ƒHead,
  1595.                            ƒTail,
  1596.                            ƒCurrent     : slNodePtr;
  1597.                            end;
  1598.              ƒdlƒList    = record
  1599.                            DataRecSize : word;
  1600.                            Count       : LongInt;
  1601.                            Head,
  1602.                            Tail,
  1603.                            Current     : dlNodePtr;
  1604.                            end;
  1605.              These are the structures of the singly and doubly linked
  1606.         lists, respectively. You will be passing a variable of one of
  1607.         these types to almost all of the routines in the unit. The actual
  1608.         details of the structure need not concern you, however, unless
  1609.         you need to modify the code of the unit.
  1610.  
  1611. unit ƒShƒList
  1612.              ƒdlƒLessFunc = function(var DataRec1, DataRec2)  : boolean;
  1613.              This is the form of a function which you will need to con-
  1614.         struct if you are using the dlPutSorted routine. It is used to
  1615.         determine the sort order of your data records. Its use is identi-
  1616.         cal in concept to the "less" function of the TurboSort, TpSort,
  1617.         or OpSort units.
  1618.  
  1619. unit ƒShƒList
  1620.         ƒAPPEND
  1621.         Declarations:
  1622.              function ƒslAppend(var L : slList; var DataRec) : boolean;
  1623.              function ƒdlAppend(var L : dlList; var DataRec) : boolean;
  1624. .
  1625.         Purpose:
  1626.              Appends a data record to an existing list. If the list is
  1627.         empty, Append simply places the record in the list.
  1628. .
  1629.         Comments:
  1630.              The list must have been initialized prior to calling Append.
  1631.         Append returns a value of "false" if insufficient heap space is
  1632.         available for allocation of the node and data record.
  1633. .
  1634.         Examples:
  1635.              if not slAppend(MyList, MyDataRecord) then begin
  1636.                {Execute your recovery code}
  1637.                end;
  1638. .
  1639.         See Also:
  1640.              Put, PutPrev, PutSorted, Push
  1641.  
  1642. unit ƒShƒList
  1643.         ƒCOUNT
  1644.         Declarations:
  1645.              function ƒslCount(L : slList) : LongInt;
  1646.              function ƒdlCount(L : dlList) : LongInt;
  1647. .
  1648.         Purpose:
  1649.              Returns the number of items currently in the list.
  1650. .
  1651.         Comments:
  1652.              The item count is maintained continuously within the list
  1653.         structure, so it is not necessary to scan the list in order to
  1654.         generate the count.
  1655. .
  1656.         Examples:
  1657.              for T1 := 1 to slCount(MyList) do begin
  1658.                if slPop(MyList, MyDataRec) then ;
  1659.                (* Now process the record *)
  1660.                end; {for T1 := ...}
  1661. .
  1662.              This code will process each record in the list, and the list
  1663.         will be left empty on loop exit.
  1664.  
  1665. unit ƒShƒList
  1666.         ƒFREE
  1667.         Declarations:
  1668.              procedure ƒslFree(var L : slList);
  1669.              procedure ƒdlFree(var L : dlList);
  1670. .
  1671.         Purpose:
  1672.              Releases the heap space allocated for a list and its data.
  1673. .
  1674.         Comments:
  1675.              This procedure should be called as soon as you have com-
  1676.         pleted your operations on the specified list. The list must be
  1677.         re-initialized if it is to be reused.
  1678. .
  1679.         Examples:
  1680.              slFree(MyList);
  1681. .
  1682.              All heap space associated with "MyList" is released, follow-
  1683.         ing which all the internal pointers of "MyList" are set to "nil"
  1684.         and the associated data record length is set to zero.
  1685. .
  1686.         See Also:
  1687.              Init
  1688.  
  1689. unit ƒShƒList
  1690.         ƒGETCURRENT
  1691.         Declarations:
  1692.              function ƒslGetCurrent(var L : slList;
  1693.                                                   var DataRec) : boolean;
  1694.              function ƒdlGetCurrent(var L : dlList;
  1695.                                                   var DataRec) : boolean;
  1696. .
  1697.         Purpose:
  1698.              Returns the data record at the current node and does not
  1699.         move the node pointer. Returns a function value of false if the
  1700.         list is empty or the current node pointer is nil.
  1701. .
  1702.         Comments:
  1703.              This is essentially a "reread" operation. Normally, the cur-
  1704.         rent node pointer will have been positioned during the course of
  1705.         some other operation (e.g., GetFirst) and the data record will
  1706.         have been returned as a result of that prior operation.
  1707. .
  1708.         Examples:
  1709.              if not slGetCurrent(MyList, MyDataRec) then begin
  1710.                {Trying to read an empty list.}
  1711.                end;
  1712. .
  1713.         See Also:
  1714.              GetFirst GetNext GetLast GetPrev
  1715.  
  1716. unit ƒShƒList
  1717.         ƒGETFIRST
  1718.         Declarations:
  1719.              function ƒslGetFirst(var L : slList; var DataRec) : boolean;
  1720.              function ƒdlGetFirst(var L : dlList; var DataRec) : boolean;
  1721. .
  1722.         Purpose:
  1723.              Returns the data record at the head of the list. Sets the
  1724.         current node pointer to the head of the list. Returns a function
  1725.         value of false if the list is empty.
  1726. .
  1727.         Comments:
  1728. .
  1729.         Examples:
  1730.              if not slGetFirst(MyList, MyDataRec) then begin
  1731.                {Trying to read an empty list.}
  1732.                end;
  1733. .
  1734.         See Also:
  1735.              GetCurrent GetNext GetLast GetPrev
  1736.  
  1737. unit ƒShƒList
  1738.         ƒGETLAST
  1739.         Declarations:
  1740.              function ƒslGetLast(var L : slList; var DataRec) : boolean;
  1741.              function ƒdlGetLast(var L : dlList; var DataRec) : boolean;
  1742. .
  1743.         Purpose:
  1744.              Returns the data record at the tail of the list. Sets the
  1745.         current node pointer to the tail of the list. Returns a function
  1746.         value of false if the list is empty.
  1747. .
  1748.         Comments:
  1749. .
  1750.         Examples:
  1751.              if not slGetLast(MyList, MyDataRec) then begin
  1752.                {Trying to read an empty list.}
  1753.                end;
  1754. .
  1755.         See Also:
  1756.              GetCurrent GetFirst GetNext GetPrev
  1757.  
  1758. unit ƒShƒList
  1759.         ƒGETNEXT
  1760.         Declarations:
  1761.              function ƒslGetNext(var L : slList; var DataRec) : boolean;
  1762.              function ƒdlGetNext(var L : dlList; var DataRec) : boolean;
  1763. .
  1764.         Purpose:
  1765.              Returns the next data record in the list. Sets the current
  1766.         node pointer to the record retrieved. Returns a function value of
  1767.         false if the list is empty or if the last record successfully
  1768.         retrieved was at the list tail. In this latter case, calling
  1769.         slGetNext or dlGetNext again will retrieve the head of the list.
  1770. .
  1771.         Comments:
  1772. .
  1773.         Examples:
  1774.           {The following example assumes boolean short-circuiting ($B+)}
  1775.              if (not slGetNext(MyList, MyDataRec))
  1776.                {slGetNext false means an empty list or end of list}
  1777.                and slGetNext(MyList, MyDataRec) then begin
  1778.                {processing the head of the list}
  1779.                end
  1780.              else begin
  1781.                {processing the normal "next" element in the list}
  1782.                end;
  1783. .
  1784.         See Also:
  1785.              GetCurrent GetFirst GetLast GetPrev
  1786.  
  1787. unit ƒShƒList
  1788.         ƒGETPREV
  1789.         Declarations:
  1790.              function ƒdlGetPrev(var L : dlList; var DataRec) : boolean;
  1791. .
  1792.         Purpose:
  1793.              Same as dlGetNext, but in the opposite direction. Returns
  1794.         the previous data record in the list. Sets the current node
  1795.         pointer to the record retrieved. Returns a function value of
  1796.         false if the list is empty or if the last record successfully
  1797.         retrieved was at the list head. In this latter case, calling
  1798.         dlGetPrev again will retrieve the tail of the list.
  1799. .
  1800.         Comments:
  1801.              Note that the GetPrev operation can only be performed on
  1802.         doubly linked lists. There is no equivalent operation for singly
  1803.         linked lists.
  1804. .
  1805.         Examples:
  1806.           {The following example assumes boolean short-circuiting ($B+)}
  1807.              if (not dlGetPrev(MyList, MyDataRec))
  1808.                {dlGetPrev false means an empty list or top of list}
  1809.                and dlGetPrev(MyList, MyDataRec) then begin
  1810.                {processing the tail of the list}
  1811.                end
  1812.              else begin
  1813.                {processing the normal "prior" element in the list}
  1814.                end;
  1815. .
  1816.         See Also:
  1817.              GetCurrent GetFirst GetLast GetNext
  1818.  
  1819. unit ƒShƒList
  1820.         ƒLISTINIT
  1821.         Declarations:
  1822.              procedure ƒslListInit(var L : slList; RecSize : word);
  1823.              procedure ƒdlListInit(var L : dlList; RecSize : word);
  1824. .
  1825.         Purpose:
  1826.              Initializes a singly or doubly linked list, as appropriate.
  1827. .
  1828.         Comments:
  1829.              The list initialization routines initialize only the vari-
  1830.         ables of type slList or dlList. They perform no memory alloca-
  1831.         tion. Memory allocation is performed only by the various PUT
  1832.         routines.
  1833. .
  1834.              The ListInit routines **must** be called before any attempt
  1835.         is made to place any data in, or retrieve any data from any
  1836.         LIST-type variable. Also, once an initialized list has received
  1837.         data, ListInit **must not** be called prior to a call to Free.
  1838.         Failure to observe either of these warnings will produce
  1839.         unpredictable but probably disastrous results.
  1840. .
  1841.         Examples:
  1842.              slListInit(MyList);
  1843. .
  1844.         See Also:
  1845.              Free
  1846.  
  1847. unit ƒShƒList
  1848.         ƒPOP
  1849.         Declarations:
  1850.              function ƒslPop(var L : slList; var DataRec) : boolean;
  1851.              function ƒdlPop(var L : dlList; var DataRec) : boolean;
  1852. .
  1853.         Purpose:
  1854.              Returns the data record at the head of the list, then deal-
  1855.         locates the space associated with the data record and node. Re-
  1856.         turns a function value of false if the list is empty.
  1857. .
  1858.         Comments:
  1859. .
  1860.         Examples:
  1861.              while slPop(MyList, MyDataRec) do begin
  1862.                {process the retrieved record}
  1863.                end;
  1864. .
  1865.              This code will retrieve each record on the list and free up
  1866.         the space associated with each, as it is retrieved. You will end
  1867.         up with an empty list.
  1868. .
  1869.         See Also:
  1870.              Push Free
  1871.  
  1872. unit ƒShƒList
  1873.         ƒPUSH
  1874.         Declarations:
  1875.              function ƒslPush(var L : slList; var DataRec) : boolean;
  1876.              function ƒdlPush(var L : dlList; var DataRec) : boolean;
  1877. .
  1878.         Purpose:
  1879.              Pushes a data record onto the top of the list. Returns a
  1880.         function value of false if there is insufficient heap space to
  1881.         accommodate the list node and data record.
  1882. .
  1883.         Comments:
  1884. .
  1885.         Examples:
  1886.              if not slPush(MyList, MyDataRec) then begin
  1887.                {perform recovery operations}
  1888.                end;
  1889. .
  1890.         See Also:
  1891.              Append Put PutPrev PutSorted Pop
  1892.  
  1893. unit ƒShƒList
  1894.         ƒPUT
  1895.         Declarations:
  1896.              function ƒslPut(var L : slList; var DataRec) : boolean;
  1897.              function ƒdlPut(var L : dlList; var DataRec) : boolean;
  1898. .
  1899.         Purpose:
  1900.              Inserts a data record following the current node; returns
  1901.         with current pointer directed to the new node. Returns a function
  1902.         value of false if there is insufficient heap space to accommodate
  1903.         the list node and data record.
  1904. .
  1905.         Comments:
  1906. .
  1907.         Examples:
  1908.              if not slPut(MyList, MyDataRec) then begin
  1909.                {perform recovery operations}
  1910.                end;
  1911. .
  1912.         See Also:
  1913.              Append Push PutPrev PutSorted Pop
  1914.  
  1915. unit ƒShƒList
  1916.         ƒPUTPREV
  1917.         Declarations:
  1918.              function ƒdlPutPrev(var L : dlList; var DataRec) : boolean;
  1919. .
  1920.         Purpose:
  1921.              Inserts a data record ahead of the current node; returns
  1922.         with current pointer directed to the new node. Returns a function
  1923.         value of false if there is insufficient heap space to accommodate
  1924.         the list node and data record.
  1925. .
  1926.         Comments:
  1927.              Note that the PutPrev operation can only be performed on
  1928.         doubly linked lists. There is no equivalent operation for singly
  1929.         linked lists.
  1930. .
  1931.         Examples:
  1932.              if not dlPutPrev(MyList, MyDataRec) then begin
  1933.                {perform recovery operations}
  1934.                end;
  1935. .
  1936.         See Also:
  1937.              Append GetPrev Push Put PutSorted
  1938.  
  1939. unit ƒShƒList
  1940.         ƒPUTSORTED
  1941.         Declarations:
  1942.              function ƒdlPutSorted(var L : dlList; var DataRec;
  1943.                                            Less : dlLessFunc) : boolean;
  1944. .
  1945.         Purpose:
  1946.              Inserts a data record into the list in sorted order, as
  1947.         determined by the user-defined boolean function LESS. Returns a
  1948.         function value of false if there is insufficient heap space to
  1949.         accommodate the list node and data record.
  1950. .
  1951.         Comments:
  1952.              The function LESS is a user-defined boolean function whose
  1953.         declaration **must** be of the form
  1954. .
  1955.              function Less(var Rec1, Rec2) :boolean;
  1956. .
  1957.         and **must** be compiled under the FAR model.
  1958. .
  1959.              Note that the PutSorted operation can only be performed on
  1960.         doubly linked lists. There is no equivalent operation for singly
  1961.         linked lists.
  1962. .
  1963.              Note also that, to build the sorted list in descending order
  1964.         rather than ascending, it is only necessary to reverse the sense
  1965.         of the inequality in the comparison function.
  1966. .
  1967.         Examples:
  1968.              {$F+}
  1969.              function MyLess(var MyRec1, MyRec2) : boolean;
  1970.                begin
  1971.                  MyLess := (MyRecType(MyRec1).FieldA <
  1972.                              MyRecType(MyRec2).FieldA);
  1973.                  end;
  1974.              {$F-}
  1975.              ...
  1976.              if not dlPutSorted(MyList, MyDataRec, @MyLess) then begin
  1977.                {do something}
  1978.                end;
  1979.              Incorrect!!! The @-symbol cannot be used here.
  1980. .
  1981.              if not dlPutSorted(MyList, MyDataRec, MyLess) then begin
  1982.                {do something}
  1983.                end;
  1984.              Correct. Only the function name is passed.
  1985. .
  1986.         See Also:
  1987.              Append GetPrev Push Put PutPrev
  1988.  
  1989. unit ƒShƒList
  1990.         ƒSPACEUSED
  1991.         Declarations:
  1992.              function ƒslSpaceUsed(L : slList) : LongInt;
  1993.              function ƒdlSpaceUsed(L : dlList) : LongInt;
  1994. .
  1995.         Purpose:
  1996.              Returns the total amount of heap space currently allocated
  1997.         to the list and its data.
  1998. .
  1999.         Comments:
  2000. .
  2001.         Examples:
  2002.              WriteLn(slSpaceUsed(MyList), ' total bytes used');
  2003. .
  2004.         See Also:
  2005.              Count
  2006.  
  2007. unit ƒShƒLngStr
  2008.              ƒLongStringType  = record
  2009.                                  ƒLength,           {Dynamic length}
  2010.                                  ƒdLength : word;   {"Declared" length}
  2011.                                  ƒlsData  : array[1..1] of char;
  2012.                                  end;
  2013.              The record structure allocated on the heap for the storage
  2014.         of LongString data.
  2015. .
  2016.              ƒLongString      = ^LongStringType;
  2017.              The type expected as actual parameters to the routines in
  2018.         this unit; also, the type returned by most of the functions.
  2019. .
  2020.              ƒlsCompType      = (Less, Equal, Greater);
  2021.              The type returned by the LongString comparison functions.
  2022. .
  2023.              ƒlsDelimSetType  = set of char;
  2024.              The type of the set of characters which the GetNext routines
  2025.         will use as word delimiters.
  2026. .
  2027.              ƒCharSet         = set of Char;
  2028.  
  2029. .
  2030.              ƒRingSize : byte = 25;
  2031.              The number of elements in the ring buffer, used to store
  2032.         pointers returned by function calls of type LongString. This
  2033.         value may be freely increased to a maximum value of 100 during
  2034.         program execution, if necessary. Decreasing it, however, could
  2035.         result in orphan blocks allocated on the heap, with no way to
  2036.         recover them.
  2037. .
  2038.              ƒlsDelimSet  : lsDelimSetType = [#0..#32];
  2039.              The typed constant used by the GetNext routines to determine
  2040.         the end of a substring to be returned. It may be freely changed
  2041.         during program execution.
  2042. .
  2043.              ƒMaxLongString = 65517;
  2044.              The maximum length of a LongString.
  2045. .
  2046.              ƒNotFound = 0;
  2047.              Returned by the lsPos functions if a substring is not found.
  2048.  
  2049. unit ƒShƒLngStr
  2050.         ƒlsCENTER
  2051.         Declarations:
  2052.              procedure lsCenter
  2053.                   (A: LongString; Width: word; B: LongString);
  2054.              function ƒlsƒCenterF
  2055.                   (A: LongString; Width: word): LongString;
  2056. .
  2057.         Purpose:
  2058.              Return a LongString centered in a LongString of blanks with
  2059.         specified width.
  2060. .
  2061.         Examples:
  2062.              If             A contains "abcdefg"
  2063.              then           lsCenter(A, 13, B);
  2064.              results in     B containing "   abcdefg   "
  2065. .
  2066.         Comments:
  2067.              If the length of A already exceeds Width, A will be returned
  2068.         unchanged.
  2069. .
  2070.         See Also:
  2071.              lsCenterCh
  2072.  
  2073. unit ƒShƒLngStr
  2074.         ƒlsCENTERCH
  2075.         Declarations:
  2076.              procedure lsCenterCh
  2077.                   (A: LongString; Ch: Char; Width: word; B: LongString);
  2078.              function ƒlsƒCenterChF
  2079.                   (A: LongString; Ch: Char; Width: word): LongString;
  2080. .
  2081.         Purpose:
  2082.              Return a LongString centered in a LongString of Ch with spe-
  2083.         cified width.
  2084. .
  2085.         Examples:
  2086.              If             A contains "abcdefg"
  2087.              then           lsCenterCh(A, '+', 13, B);
  2088.              results in     B containing "+++abcdefg+++"
  2089. .
  2090.         Comments:
  2091.              If the length of A already exceeds Width, A will be returned
  2092.         unchanged.
  2093. .
  2094.         See Also:
  2095.              lsCenter
  2096.  
  2097. unit ƒShƒLngStr
  2098.         ƒlsCHARSTR
  2099.         Declarations:
  2100.              procedure lsCharStr
  2101.                   (Ch: Char; Len: word; A: LongString);
  2102.              function ƒlsƒCharStrF
  2103.                   (Ch: Char; Len: word): LongString;
  2104. .
  2105.         Purpose:
  2106.              Return a LongString of length Len filled with Ch.
  2107. .
  2108.         Examples:
  2109.              The call       lsCharStr('+', 10, A);
  2110.              results in     A containing "++++++++++"
  2111. .
  2112.         Comments:
  2113.              If Len is greater than the maximum length of A, the returned
  2114.         LongString will be equal in length to the maximum length of A.
  2115. .
  2116.         See Also:
  2117.  
  2118. unit ƒShƒLngStr
  2119.         ƒlsCOMP
  2120.         Declarations:
  2121.              function lsƒComp
  2122.                   (A1, A2: LongString): lsCompType;
  2123. .
  2124.         Purpose:
  2125.              Compares A1 to A2, returning LESS, EQUAL, or GREATER.
  2126. .
  2127.         Examples:
  2128.                 For a normal COMPARE,
  2129.                         case lsComp(LS1, LS2) of
  2130.                           LESS    : {Do This}
  2131.                           EQUAL   : {Do That}
  2132.                           GREATER : {Do The Other}
  2133.                           end; {case lsComp}
  2134. .
  2135.                 For a case-insensitive COMPARE,
  2136.                         case lsComp(lsUpcaseF(LS1), lsUpcaseF(LS2)) of
  2137.                           LESS    : {Do This}
  2138.                           EQUAL   : {Do That}
  2139.                           GREATER : {Do The Other}
  2140.                           end; {case lsComp}
  2141. .
  2142.         Comments:
  2143.              This function completely implements the analog of the string
  2144.         comparison operators of Turbo Pascal.
  2145. .
  2146.         See Also:
  2147.  
  2148. unit ƒShƒLngStr
  2149.         ƒlsCONCAT
  2150.         Declarations:
  2151.              procedure lsConcat
  2152.                   (A, B, C: LongString);
  2153.              function ƒlsƒConcatF
  2154.                   (A, B: LongString): LongString;
  2155.              procedure lsConcatLs2Str
  2156.                   (S: string; A: LongString; C: LongString);
  2157.              function ƒlsƒConcatLs2StrF
  2158.                   (S: string; A: LongString): LongString;
  2159.              procedure lsConcatStr2Ls
  2160.                   (A: LongString; S: string; C: LongString);
  2161.              function ƒlsƒConcatStr2LsF
  2162.                   (A: LongString; S: string): LongString;
  2163. .
  2164.         Purpose:
  2165.              Concatenate the second parameter to the end of the first.
  2166. .
  2167.         Examples:
  2168.              If             A contains "abcdefg"
  2169.              and            B contains "hijklmn"
  2170.              then           lsConcat(A, B, C);
  2171.              results in     C containing "abcdefghijklmn"
  2172. .
  2173.         Comments:
  2174. .
  2175.         See Also:
  2176.  
  2177. unit ƒShƒLngStr
  2178.         ƒlsCOPY
  2179.         Declarations:
  2180.              procedure lsCopy
  2181.                   (A: LongString; Start, Len: word; B: LongString);
  2182.              function ƒlsƒCopyF
  2183.                   (A: LongString; Start, Len: word): LongString;
  2184. .
  2185.         Purpose:
  2186.              Return a LongString substring of A. The substring begins at
  2187.         position Start of A and will be of length Len.
  2188. .
  2189.         Examples:
  2190.              If             A contains "abcdefg"
  2191.              then           lsCopy(A, 4, 3, B);
  2192.              results in     B containing "def"
  2193. .
  2194.              If             A contains "abcdefg"
  2195.              then           lsCopy(A, 4, 10, B);
  2196.              results in     B containing "defg"
  2197. .
  2198.         Comments:
  2199.              Start=1 for first char in A.
  2200.  
  2201.              If Start > lsLength(A), an empty LongString will be
  2202.         returned.
  2203. .
  2204.              If Start+Len exceeds the length of A, the returned
  2205.         LongString will be of length lsLength(A)-Start+1.
  2206. .
  2207.         See Also:
  2208.  
  2209. unit ƒShƒLngStr
  2210.         ƒlsCOUNT
  2211.         Declarations:
  2212.              function lsƒCount
  2213.                   (A, Obj: LongString):  word;
  2214.              function ƒlsƒCountStr
  2215.                   (A: LongString; Obj: string): word;
  2216.              function ƒlsƒCountStrUC
  2217.                   (A: LongString; Obj: string): word;
  2218.              function ƒlsƒCountUC
  2219.                   (A, Obj: LongString):  word;
  2220. .
  2221.         Purpose:
  2222.              Returns the total number of non-overlapping occurrences of
  2223.         Obj in A.
  2224. .
  2225.         Examples:
  2226.              if lsCountStrUC(MyLS, 'abc') <> NotFound then {Do something}
  2227. .
  2228.              If             A contains "abcdeabcdeabcde"
  2229.              and            Obj contains "BCD"
  2230.              then           lsCount(A, Obj)
  2231.              returns        NotFound ( = 0 )
  2232.              but            lsCountUC(A, Obj)
  2233.              returns        3
  2234. .
  2235.         Comments:
  2236.              If Obj is not a substring of A, returns NotFound (i.e., 0).
  2237. .
  2238.         See Also:
  2239.  
  2240. unit ƒShƒLngStr
  2241.         ƒlsDELALL
  2242.         Declarations:
  2243.              procedure lsDelAll
  2244.                   (A, Obj, B: LongString);
  2245.              function ƒlsƒDelAllF
  2246.                   (A, Obj: LongString):  LongString;
  2247.              procedure lsDelAllStr
  2248.                   (A: LongString; Obj: string; B: LongString);
  2249.              function ƒlsƒDelAllStrF
  2250.                   (A: LongString; Obj: string): LongString;
  2251.              procedure lsDelAllStrUC
  2252.                   (A: LongString; Obj: string; B: LongString);
  2253.              function ƒlsƒDelAllStrUCF
  2254.                   (A: LongString; Obj: string): LongString;
  2255.              procedure lsDelAllUC
  2256.                   (A, Obj, B: LongString);
  2257.              function ƒlsƒDelAllUCF
  2258.                   (A, Obj: LongString):  LongString;
  2259. .
  2260.         Purpose:
  2261.              Deletes all occurrences of Obj in A.
  2262. .
  2263.         Examples:
  2264.              See below.
  2265. .
  2266.         Comments:
  2267.              Should the deletion of Obj from A result in a new occurrence
  2268.         of Obj in A, the new occurrence will not be deleted, e.g.,
  2269. .
  2270.              If             A contains 'aabcbcabcd'
  2271.              and            Obj contains 'abc'
  2272.              then           lsDelAll(A, Obj, B);
  2273.              results in     B containing 'abcd'
  2274.              and not        'd'
  2275. .
  2276.              To delete all occurrences including such incidental
  2277.         occurrences, one would use, e.g.,
  2278. .
  2279.                             repeat
  2280.                               lsDelAll(A, Obj, A);
  2281.                               until lsCount(A, Obj) = 0;
  2282. .
  2283.         See Also:
  2284.              lsRepAll   lsCount
  2285.  
  2286. unit ƒShƒLngStr
  2287.         ƒlsDELETE
  2288.         Declarations:
  2289.              procedure lsDelete
  2290.                   (A: LongString; Start, Len: word; B: LongString);
  2291.              function ƒlsƒDeleteF
  2292.                   (A: LongString; Start, Len: word): LongString;
  2293. .
  2294.         Purpose:
  2295.              Delete Len characters of A, starting at position Start.
  2296. .
  2297.         Examples:
  2298.              If             A contains "abcdefg"
  2299.              then           lsDelete(A, 4, 3, B);
  2300.              results in     B containing "abcg"
  2301. .
  2302.              If             A contains "abcdefg"
  2303.              then           lsDelete(A, 4, 10, B);
  2304.              results in     B containing "abc"
  2305. .
  2306.         Comments:
  2307.              If Start is greater than the length of A, B = A on output.
  2308. .
  2309.         See Also:
  2310.              lsDelAll   lsRepAll
  2311.  
  2312. unit ƒShƒLngStr
  2313.         ƒlsDISPOSE
  2314.         Declarations:
  2315.              procedure lsDispose
  2316.                   (var A: LongString);
  2317. .
  2318.         Purpose:
  2319.              Dispose of A, releasing its heap space.
  2320. .
  2321.         Examples:
  2322.              The call       lsDispose(A);
  2323.              results in     All heap space associated with A is released
  2324.              and            A = nil
  2325. .
  2326.         Comments:
  2327. .
  2328.         See Also:
  2329.              lsInit
  2330.  
  2331. unit ƒShƒLngStr
  2332.         ƒlsGETNEXT
  2333.         Declarations:
  2334.              procedure lsGetNext
  2335.                   (LS1, LS2: LongString);
  2336.              function ƒlsƒGetNextF
  2337.                   (LS1: LongString): LongString;
  2338.              procedure lsGetNextStr
  2339.                   (LS1: LongString; var S2: string);
  2340.              function ƒlsƒGetNextStrF
  2341.                   (LS1: LongString): string;
  2342. .
  2343.         Purpose:
  2344.              Returns the next substring of LS1 which is delimited by a
  2345.         member of lsDelimSet.
  2346. .
  2347.         Examples:
  2348.              If             A contains "abc def ghi jkl"
  2349.              then the two calls
  2350.                             lsGetNext(A, B);
  2351.                             lsGetNext(A, B);
  2352.              result in      A containing " ghi jkl"
  2353.              and            B containing "def"
  2354. .
  2355.         Comments:
  2356.              On return, LS1 is returned untrimmed, but with the first
  2357.         matching substring deleted.
  2358. .
  2359.         See Also:
  2360.  
  2361. unit ƒShƒLngStr
  2362.         ƒlsINIT
  2363.         Declarations:
  2364.              function lsƒInit
  2365.                   (var A: LongString; L: word): boolean;
  2366. .
  2367.         Purpose:
  2368.              "Declares" a LongString of maximum declared length L and
  2369.         establishes space for it on the heap.
  2370. .
  2371.         Examples:
  2372.              The call       if lsInit(A, 750) then {Do something};
  2373.              results in     a. A returned function value of "true"
  2374.                             b. 754 bytes being allocated on the heap.
  2375.                                (750 bytes for the character string,
  2376.                                 4 overhead bytes.)
  2377.                             c. A containing a pointer to the heap space.
  2378. .
  2379.              The call       lsInit(A, 65518);   {MaxLongString = 65517}
  2380.              results in     a. A returned function value of "false"
  2381.                             b. No space allocation on the heap.
  2382.                             c. A = nil
  2383. .
  2384.         Comments:
  2385.              Returns false if L is greater than MaxLongString.
  2386. .
  2387.              If there is insufficient heap space to accommodate the
  2388.         LongString, the program will terminate with a run-time error of
  2389.         250 (if lsInit has been called directly) or 251 (if lsInit has
  2390.         been called while attempting to allocate space on the ring
  2391.         buffer.
  2392. .
  2393.         See Also:
  2394.              lsDispose
  2395.  
  2396. unit ƒShƒLngStr
  2397.         ƒlsIOFF
  2398.         Declarations:
  2399.              procedure lsIoff;
  2400. .
  2401.         Purpose:
  2402.              Turns I/O checking off during execution of lsReadLn and
  2403.         lsWriteLn.
  2404. .
  2405.         Examples:
  2406.                   lsIoff;
  2407.                   lsReadLn(MyFile, MyLS);
  2408.                   if lsIoResult <> 0 then {Do something}
  2409.                   lsIon;
  2410. .
  2411.         Comments:
  2412.              lsIoff, lsIon, and lsIoResult MUST be used for LongString
  2413.         I/O operations in place of $I-, $I+, and IoResult.
  2414. .
  2415.              Emulates at execution time the action of the $I- compiler
  2416.         directive, but only for LongString I/O. The default state is
  2417.         "on".
  2418. .
  2419.              If I/O checking is off lsIoResult MUST be called after each
  2420.         call to lsReadLn or lsWriteLn. If I/O checking is on, and if an
  2421.         I/O error occurs, the program will terminate with a run-time
  2422.         error. This action duplicates the action of the IoResult function
  2423.         for normal I/O.
  2424. .
  2425.         See Also:
  2426.              lsIon     lsIoResult
  2427.  
  2428. unit ƒShƒLngStr
  2429.         ƒlsION
  2430.         Declarations:
  2431.              procedure lsIon;
  2432. .
  2433.         Purpose:
  2434.              Turns I/O checking on during execution of lsReadLn and
  2435.         lsWriteLn.
  2436. .
  2437.         Examples:
  2438.                   lsIoff;
  2439.                   lsReadLn(MyFile, MyLS);
  2440.                   if lsIoResult <> 0 then {Do something}
  2441.                   lsIon;
  2442. .
  2443.         Comments:
  2444.              lsIoff, lsIon, and lsIoResult MUST be used for LongString
  2445.         I/O operations in place of $I-, $I+, and IoResult.
  2446. .
  2447.              Emulates at execution time the action of the $I+ compiler
  2448.         directive, but only for LongString I/O. The default state is
  2449.         "on".
  2450. .
  2451.              If I/O checking is off lsIoResult MUST be called after each
  2452.         call to lsReadLn or lsWriteLn. If I/O checking is on, and if an
  2453.         I/O error occurs, the program will terminate with a run-time
  2454.         error. This action duplicates the action of the IoResult function
  2455.         for normal I/O.
  2456. .
  2457.         See Also:
  2458.              lsIoff    lsIoResult
  2459.  
  2460. unit ƒShƒLngStr
  2461.         ƒlsIORESULT
  2462.         Declarations:
  2463.              function lsƒIoResult: word;
  2464. .
  2465.         Purpose:
  2466.              Returns the IoResult of the last lsReadLn or lsWriteLn
  2467.         performed, and clears the internal variable used to store the
  2468.         value.
  2469. .
  2470.         Examples:
  2471.                   lsIoff;
  2472.                   lsReadLn(MyFile, MyLS);
  2473.                   if lsIoResult <> 0 then {Do something}
  2474.                   lsIon;
  2475. .
  2476.         Comments:
  2477.              lsIoff, lsIon, and lsIoResult MUST be used for LongString
  2478.         I/O operations in place of $I-, $I+, and IoResult.
  2479. .
  2480.              If I/O checking is off lsIoResult MUST be called after each
  2481.         call to lsReadLn or lsWriteLn. If I/O checking is on, and if an
  2482.         I/O error occurs, the program will terminate with a run-time
  2483.         error. This action duplicates the action of the IoResult function
  2484.         for normal I/O.
  2485. .
  2486.         See Also:
  2487.              lsIoff    lsIon
  2488.  
  2489. unit ƒShƒLngStr
  2490.         ƒlsINSERT
  2491.         Declarations:
  2492.              procedure lsInsert
  2493.                   (A, Obj: LongString; Start: word; B: LongString);
  2494.              function ƒlsƒInsertF
  2495.                   (A, Obj: LongString; Start: word): LongString;
  2496.              procedure lsInsertStr
  2497.                   (A: LongString; Obj: string; Start: word;
  2498.                                                           B: LongString);
  2499.              function ƒlsƒInsertStrF
  2500.                   (A: LongString; Obj: string; Start: word): LongString;
  2501. .
  2502.         Purpose:
  2503.              Insert Obj into A at position Start returning a new
  2504.         LongString.
  2505. .
  2506.         Examples:
  2507.              If             A contains "abcdef"
  2508.              and            Obj contains "ABC"
  2509.              then           lsInsert(A, Obj, 4, B);
  2510.              results in     B containing "abcABCdef"
  2511. .
  2512.         Comments:
  2513.              If Start > lsLength(A), no action is taken.
  2514. .
  2515.         See Also:
  2516.              lsDelete
  2517.  
  2518. unit ƒShƒLngStr
  2519.         ƒlsLEFTPAD
  2520.         Declarations:
  2521.              procedure lsLeftPad
  2522.                   (A: LongString; Len: word; B: LongString);
  2523.              function ƒlsƒLeftPadF
  2524.                   (A: LongString; Len: word): LongString;
  2525. .
  2526.         Purpose:
  2527.              Left-pad the LongString in A to length Len with blanks,
  2528.         returning a new LongString.
  2529. .
  2530.         Examples:
  2531.              If             A contains "abc"
  2532.              then           lsLeftPad(A, 5, B);
  2533.              results in     B containing "  abc"
  2534. .
  2535.         Comments:
  2536.              If Len < lsLength(A), A is returned truncated without
  2537.         padding.
  2538. .
  2539.         See Also:
  2540.              lsLeftPadCh     lsPad           lsPadCh
  2541.  
  2542. unit ƒShƒLngStr
  2543.         ƒlsLEFTPADCH
  2544.         Declarations:
  2545.              procedure lsLeftPadCh
  2546.                   (A: LongString; Ch: Char; Len: word; B: LongString);
  2547.              function ƒlsƒLeftPadChF
  2548.                   (A: LongString; Ch: Char; Len: word): LongString;
  2549. .
  2550.         Purpose:
  2551.              Left-pad the LongString in A to length Len with Ch,
  2552.         returning a new LongString.
  2553. .
  2554.         Examples:
  2555.              If             A contains "abc"
  2556.              then           lsLeftPad(A, '+', 5, B);
  2557.              results in     B containing "++abc"
  2558. .
  2559.         Comments:
  2560. .
  2561.         See Also:
  2562.              lsLeftPad       lsPad           lsPadCh
  2563.  
  2564. unit ƒShƒLngStr
  2565.         ƒlsLENGTH
  2566.         Declarations:
  2567.              function lsƒLength
  2568.                   (A: LongString): word;
  2569. .
  2570.         Purpose:
  2571.              Return the length of a LongString. A must have been
  2572.         initialized.
  2573. .
  2574.         Examples:
  2575.              If             A contains "Cogito, ergo sum."
  2576.              then           lsLength(A)
  2577.              returns        17
  2578. .
  2579.         Comments:
  2580. .
  2581.         See Also:
  2582.  
  2583. unit ƒShƒLngStr
  2584.         ƒlsLOCASE
  2585.         Declarations:
  2586.              procedure lsLocase
  2587.                   (A, B: LongString);
  2588.              function ƒlsƒLocaseF
  2589.                   (A: LongString): LongString;
  2590. .
  2591.         Purpose:
  2592.              Locase the LongString in A, returning a new LongString.
  2593. .
  2594.         Examples:
  2595.              If             A contains "ABCdefGHIjkl"
  2596.              then           lsLocase(A, B);
  2597.              results in     B containing "abcdefghijkl"
  2598. .
  2599.         Comments:
  2600. .
  2601.         See Also:
  2602.              lsUpcase
  2603.  
  2604. unit ƒShƒLngStr
  2605.         ƒlsLONGSTRING2STR
  2606.         Declarations:
  2607.              function lsƒLongString2Str
  2608.                   (A: LongString): string;
  2609. .
  2610.         Purpose:
  2611.              Convert a LongString to a Turbo string.
  2612. .
  2613.         Examples:
  2614.              If             A (LongString) contains "abcdef"
  2615.              then           lsLongString2Str(A)
  2616.              returns        'abcdef' (string)
  2617. .
  2618.         Comments:
  2619.              If lsLength(A) > 255, the returned string will be truncated
  2620.         to length 255.
  2621. .
  2622.         See Also:
  2623.              lsStr2LongString
  2624.  
  2625. unit ƒShƒLngStr
  2626.         ƒlsPAD
  2627.         Declarations:
  2628.              procedure lsPad
  2629.                   (A: LongString; Len: word; B: LongString);
  2630.              function ƒlsƒPadF
  2631.                   (A: LongString; Len: word): LongString;
  2632. .
  2633.         Purpose:
  2634.              Right-pad the LongString in A to length Len with blanks,
  2635.         returning a new LongString.
  2636. .
  2637.         Examples:
  2638.              If             A contains "abc"
  2639.              then           lsPad(A, 5, B);
  2640.              results in     B containing "abc  "
  2641. .
  2642.              but if         lsInit(C, 5) = true
  2643.              then           lsPad(A, 8, C);
  2644.              also results in  C containing "abc  "
  2645. .
  2646.         Comments:
  2647. .
  2648.         See Also:
  2649.              lsPadCh         lsLeftPad       lsLeftPadCh
  2650.  
  2651. unit ƒShƒLngStr
  2652.         ƒlsPADCH
  2653.         Declarations:
  2654.              procedure lsPadCh
  2655.                   (A: LongString; Ch: Char; Len: word; B: LongString);
  2656.              function ƒlsƒPadChF
  2657.                   (A: LongString; Ch: Char; Len: word): LongString;
  2658. .
  2659.         Purpose:
  2660.              Right-pad the LongString in A to length Len with Ch,
  2661.         returning a new LongString.
  2662. .
  2663.         Examples:
  2664.              If             A contains "abc"
  2665.              then           lsPadCh(A, '+', 5, B);
  2666.              results in     B containing "abc++"
  2667. .
  2668.              but if         lsInit(C, 5) = true
  2669.              then           lsPadCh(A, '+', 8, C);
  2670.              also results in  C containing "abc++"
  2671. .
  2672.         Comments:
  2673. .
  2674.         See Also:
  2675.              lsPad           lsLeftPad       lsLeftPadCh
  2676.  
  2677. unit ƒShƒLngStr
  2678.         ƒlsPOS
  2679.         Declarations:
  2680.              function lsƒPos
  2681.                   (Obj, A: LongString): word;
  2682.              function ƒlsƒPosStr
  2683.                   (Obj: string; A: LongString): word;
  2684.              function ƒlsƒPosUC
  2685.                   (Obj, A: LongString): word;
  2686.              function ƒlsƒPosStrUC
  2687.                   (Obj: string; A: LongString): word;
  2688. .
  2689.         Purpose:
  2690.              Return the position of Obj in A, returning NotFound if not
  2691.         found.
  2692. .
  2693.         Examples:
  2694.              If             A contains "abcdeabcdeabcde"
  2695.              and            Obj contains "BCD"
  2696.              then           lsPos(A, Obj)
  2697.              returns        NotFound ( = 0 )
  2698.              but            lsPosUC(A, Obj)
  2699.              returns        2
  2700. .
  2701.         Comments:
  2702. .
  2703.         See Also:
  2704.  
  2705. unit ƒShƒLngStr
  2706.         ƒlsPOSSET
  2707.         Declarations:
  2708.              function lsƒPosSet(A : CharSet; S : LongString) : word;
  2709. .
  2710.         Purpose:
  2711.              Returns the position of the first occurrence of any member
  2712.         of A in S.
  2713. .
  2714.         Comments:
  2715.              This function is primarily intended for internal use.
  2716. .
  2717.         Examples:
  2718.                   If   S = 'X1Y2C3Z4B'
  2719.                   and  A = ['A','B','C']
  2720.                   then lsPosSet(A, S) will return 5.
  2721. .
  2722.         See also:
  2723.  
  2724. unit ƒShƒLngStr
  2725.         ƒlsREADLN
  2726.         Declarations:
  2727.              procedure lsReadLn
  2728.                   (var F: Text; A: LongString);
  2729. .
  2730.         Purpose:
  2731.              Read a LongString from a text file.
  2732. .
  2733.         Examples:
  2734.              lsReadLn(MyFile, A);
  2735. .
  2736.         Comments:
  2737.              If the "declared" length of A (set by lsInit) is less than
  2738.         the actual length of the line in the text file, the incoming
  2739.         string will be truncated to the "declared" length of A and the
  2740.         file will be positioned at the beginning of the next line (the
  2741.         exact analog of a normal Turbo PASCAL string ReadLn).
  2742.  
  2743.              If I/O checking is off lsIoResult MUST be called after each
  2744.         call to lsReadLn or lsWriteLn. If I/O checking is on, and if an
  2745.         I/O error occurs, the program will terminate with a run-time
  2746.         error. This action duplicates the action of the IoResult function
  2747.         for normal I/O.
  2748. .
  2749.         See Also:
  2750.              lsIoff    lsIon     lsIoResult     lsWriteLn
  2751.  
  2752. unit ƒShƒLngStr
  2753.         ƒlsREPALL
  2754.         Declarations:
  2755.              procedure lsRepAll
  2756.                   (A, Obj, Obj1, B: LongString);
  2757.              function ƒlsƒRepAllF
  2758.                   (A, Obj, Obj1: LongString):  LongString;
  2759.              procedure lsRepAllStr
  2760.                   (A: LongString; Obj, Obj1: string; B: LongString);
  2761.              function ƒlsƒRepAllStrF
  2762.                   (A: LongString; Obj, Obj1: string): LongString;
  2763.              procedure lsRepAllStrUC
  2764.                   (A: LongString; Obj, Obj1: string; B: LongString);
  2765.              function ƒlsƒRepAllStrUCF
  2766.                   (A: LongString; Obj, Obj1: string): LongString;
  2767.              procedure lsRepAllUC
  2768.                   (A, Obj, Obj1, B: LongString);
  2769.              function ƒlsƒRepAllUCF
  2770.                   (A, Obj, Obj1: LongString): LongString;
  2771. .
  2772.         Purpose:
  2773.              Replaces all occurrences of Obj in A with Obj1.
  2774. .
  2775.         Examples:
  2776.              If             A contains 'aabcbcabcd'
  2777.              and            Obj contains 'abc'
  2778.              and            Obj1 contains '12345'
  2779.              then           lsRepAll(A, Obj, Obj1, B);
  2780.              results in     B containing 'a12345bc12345d'
  2781. .
  2782.         Comments:
  2783.              Should the replacement of Obj by Obj1 in A result in a new
  2784.         occurrence of Obj in A, the new occurrence will not be replaced.
  2785.         To do so, except under rather unusual conditions, could result in
  2786.         a non-terminating condition.
  2787. .
  2788.         See Also:
  2789.              lsDelAll
  2790.  
  2791. unit ƒShƒLngStr
  2792.         ƒlsSIZEOF
  2793.         Declarations:
  2794.              function lsƒSizeOf
  2795.                   (A: LongString): word;
  2796. .
  2797.         Purpose:
  2798.              Returns the total heap space required for A, including the
  2799.         two control words. A must have been initialized.
  2800. .
  2801.         Examples:
  2802.              See below.
  2803. .
  2804.         Comments:
  2805.              lsSizeOf MUST be used to determine the effective size of a
  2806.         LongString. Any attempt to use SizeOf(A) will return a value of
  2807.         4; any attempt to use SizeOf(A^) will return a value of 5.
  2808.         Neither is particularly informative!
  2809. .
  2810.              Remember that, just as
  2811.                               SizeOf(StringVariable)
  2812.         returns a value one greater than the declared length of
  2813.         StringVariable, so
  2814.                            lsSizeOf(LongStringVariable)
  2815.         will return a value four greater than the "declared" length of
  2816.         LongStringVariable.
  2817. .
  2818.              If A has not been initialized, the results are
  2819.         unpredictable.
  2820. .
  2821.         See Also:
  2822.              lsLength
  2823.  
  2824. unit ƒShƒLngStr
  2825.         ƒlsSTR2LONGSTRING
  2826.         Declarations:
  2827.              procedure lsStr2LongString
  2828.                   (S: string; A: LongString);
  2829.              function ƒlsƒStr2LongStringF
  2830.                   (S: string): LongString;
  2831. .
  2832.         Purpose:
  2833.              Convert a Turbo string into a LongString.
  2834. .
  2835.         Examples:
  2836.              If             S (string) contains "abcdef"
  2837.              then           lsStr2LongString(S, A);
  2838.              results in     A (LongString) containing "abcdef"
  2839. .
  2840.         Comments:
  2841. .
  2842.         See Also:
  2843.              lsLongString2Str
  2844.  
  2845. unit ƒShƒLngStr
  2846.         ƒlsTRANSFER
  2847.         Declarations:
  2848.              procedure lsTransfer
  2849.                   (A, B: LongString);
  2850. .
  2851.         Purpose:
  2852.              Transfers the contents of A into B.
  2853. .
  2854.         Examples:
  2855.              B^ := A^;
  2856.              INCORRECT!! This construct will give unpredictable but guar-
  2857.         anteed incorrect results.
  2858. .
  2859.              lsTransfer(A, B);
  2860.              Correct. ALWAYS use lsTransfer to move the contents of one
  2861.         LongString into another.
  2862. .
  2863.         Comments:
  2864. .
  2865.         See Also:
  2866.  
  2867. unit ƒShƒLngStr
  2868.         ƒlsTRIM
  2869.         Declarations:
  2870.              procedure lsTrim
  2871.                   (A, B: LongString);
  2872.              function ƒlsƒTrimF
  2873.                   (A: LongString): LongString;
  2874. .
  2875.         Purpose:
  2876.              Return a LongString with leading and trailing white space
  2877.         removed.
  2878. .
  2879.         Examples:
  2880.              If             A contains "  Cogito, ergo sum.      "
  2881.              then           lsTrim(A, B);
  2882.              results in     B containing "Cogito, ergo sum."
  2883. .
  2884.         Comments:
  2885.              "White space" is any sequence of characters in the range
  2886.         #0..#32.
  2887. .
  2888.         See Also:
  2889.              lsTrimLead     lsTrimTrail
  2890.              lsTrimLeadSet  lsTrimSet      lsTrimTrailSet
  2891.  
  2892. unit ƒShƒLngStr
  2893.         ƒlsTRIMLEAD
  2894.         Declarations:
  2895.              procedure lsTrimLead
  2896.                   (A, B: LongString);
  2897.              function ƒlsƒTrimLeadF
  2898.                   (A: LongString): LongString;
  2899. .
  2900.         Purpose:
  2901.              Return a LongString with leading white space removed.
  2902. .
  2903.         Examples:
  2904.              If             A contains "  Cogito, ergo sum.      "
  2905.              then           lsTrimLead(A, B);
  2906.              results in     B containing "Cogito, ergo sum.      "
  2907. .
  2908.         Comments:
  2909.              "White space" is any sequence of characters in the range
  2910.         #0..#32.
  2911. .
  2912.         See Also:
  2913.              lsTrim         lsTrimTrail
  2914.              lsTrimLeadSet  lsTrimSet      lsTrimTrailSet
  2915.  
  2916. unit ƒShƒLngStr
  2917.         ƒlsTRIMTRAIL
  2918.         Declarations:
  2919.              procedure lsTrimTrail
  2920.                   (A, B: LongString);
  2921.              function ƒlsƒTrimTrailF
  2922.                   (A: LongString): LongString;
  2923. .
  2924.         Purpose:
  2925.           Return a LongString with trailing white space removed.
  2926. .
  2927.         Examples:
  2928.              If             A contains "  Cogito, ergo sum.      "
  2929.              then           lsTrimTrail(A, B);
  2930.              results in     B containing "  Cogito, ergo sum."
  2931. .
  2932.         Comments:
  2933.              "White space" is any sequence of characters in the range
  2934.         #0..#32.
  2935. .
  2936.         See Also:
  2937.              lsTrim         lsTrimLead
  2938.              lsTrimLeadSet  lsTrimSet      lsTrimTrailSet
  2939.  
  2940. unit ƒShƒLngStr
  2941.         ƒlsTRIMLEADSET
  2942.         Declarations:
  2943.              procedure lsTrimLeadSet
  2944.                   (A : LongString; CS : CharSet; B : LongString);
  2945.              function ƒlsƒTrimLeadSetF
  2946.                   (A : LongString; CS : CharSet) : LongString;
  2947. .
  2948.         Purpose:
  2949.              Returns a LongString with leading characters in CS stripped.
  2950. .
  2951.         Examples:
  2952.              See the file TESTLSTR.PAS
  2953. .
  2954.         Comments:
  2955.              CS contains an arbitrary set of characters.
  2956. .
  2957.         See also:
  2958.              lsTrimSet lsTrimTrailSet
  2959.              lsTrim    lsTrimLead     lsTrimTrail
  2960.  
  2961. unit ƒShƒLngStr
  2962.         ƒlsTRIMSET
  2963.         Declarations:
  2964.              procedure lsTrimSet
  2965.                   (A : LongString; CS : CharSet; B : LongString);
  2966.              function ƒlsƒTrimSetF
  2967.                   (A  : LongString; CS : CharSet) : LongString;
  2968. .
  2969.         Purpose:
  2970.              Returns a LongString with leading and trailing characters in
  2971.         CS stripped.
  2972. .
  2973.         Examples:
  2974.              See the file TESTLSTR.PAS
  2975. .
  2976.         Comments:
  2977.              CS contains an arbitrary set of characters.
  2978. .
  2979.         See also:
  2980.              lsTrimLeadSet  lsTrimTrailSet
  2981.              lsTrim         lsTrimLead     lsTrimTrail
  2982.  
  2983. unit ƒShƒLngStr
  2984.         ƒlsTRIMTRAILSET
  2985.         Declarations:
  2986.              procedure lsTrimTrailSet
  2987.                   (A : LongString; CS : CharSet; B : LongString);
  2988.              function ƒlsƒTrimTrailSetF
  2989.                   (A : LongString; CS : CharSet) : LongString;
  2990. .
  2991.         Purpose:
  2992.              Returns a LongString with trailing characters in CS
  2993.         stripped.
  2994. .
  2995.         Examples:
  2996.              See the file TESTLSTR.PAS
  2997. .
  2998.         Comments:
  2999.              CS contains an arbitrary set of characters.
  3000. .
  3001.         See also:
  3002.              lsTrimLeadSet  lsTrimSet
  3003.              lsTrim         lsTrimLead     lsTrimTrail
  3004.  
  3005. unit ƒShƒLngStr
  3006.         ƒlsUPCASE
  3007.         Declarations:
  3008.              procedure lsUpcase
  3009.                   (A, B: LongString);
  3010.              function ƒlsƒUpcaseF
  3011.                   (A: LongString): LongString;
  3012. .
  3013.         Purpose:
  3014.              Upcase the LongString in A, returning a new LongString.
  3015. .
  3016.         Examples:
  3017.              If             A contains "ABCdefGHIjkl"
  3018.              then           lsUpcase(A, B);
  3019.              results in     B containing "ABCDEFGHIJKL"
  3020. .
  3021.         Comments:
  3022. .
  3023.         See Also:
  3024.              lsLocase
  3025.  
  3026. unit ƒShƒLngStr
  3027.         ƒlsWRITELN
  3028.         Declarations:
  3029.              procedure lsWriteLn
  3030.                   (var F: Text; A: LongString);
  3031. .
  3032.         Purpose:
  3033.              Write a LongString to a text file.
  3034. .
  3035.         Examples:
  3036.              lsWriteLn(MyFile, A);
  3037. .
  3038.         Comments:
  3039.              If I/O checking is off lsIoResult MUST be called after each
  3040.         call to lsReadLn or lsWriteLn. If I/O checking is on, and if an
  3041.         I/O error occurs, the program will terminate with a run-time
  3042.         error. This action duplicates the action of the IoResult function
  3043.         for normal I/O.
  3044. .
  3045.         See Also:
  3046.              lsIoff    lsIon     lsIoResult     lsReadLn
  3047.  
  3048. unit ƒShƒUtilPk
  3049.              ƒDelimSetType = Set of Char;
  3050. .
  3051.              ƒDelimSet : DelimSetType = [#0..#32];
  3052.              The typed constant used by the GetNext routines to determine
  3053.         the end of a substring to be returned. It may be freely changed
  3054.         during program execution.
  3055. .
  3056.              ƒCharSet      = Set of Char;
  3057.  
  3058. unit ƒShƒUtilPk
  3059.              ƒStartingMode : Integer;
  3060.              {Initial video mode of the system (Mono, CO80, BW40, ...)}
  3061. .
  3062.              ƒStartingAttr : Byte;
  3063.              {Initial video attribute of the system}
  3064.  
  3065. unit ƒShƒUtilPk
  3066.         ƒBETWS
  3067.         Declarations:
  3068.              function BetwS(Lower, Item, Upper  : LongInt) : boolean;
  3069. .
  3070.         Purpose:
  3071.              Performs a SIGNED test of the condition that
  3072. .
  3073.                               Lower <= Item <= Upper
  3074. .
  3075.         returning TRUE if and only if the condition is met.
  3076. .
  3077.         Comments:
  3078.              Lower, Item, and Upper can be any combination of 1, 2, and
  3079.         4-byte entities.
  3080. .
  3081.              Note that
  3082.                   BetwU($EA, $EA, $FA) = true
  3083.              whereas
  3084.                   BetwS($EA, $EA, $FA) = false
  3085. .
  3086.         Examples:
  3087.              See TESTBETW.PAS
  3088. .
  3089.         See also:
  3090.              BetwU
  3091.  
  3092. unit ƒShƒUtilPk
  3093.         ƒBETWU
  3094.         Declarations:
  3095.              function BetwU(Lower, Item, Upper  : LongInt) : boolean;
  3096. .
  3097.         Purpose:
  3098.              Performs an UNSIGNED test of the condition that
  3099. .
  3100.                               Lower <= Item <= Upper
  3101. .
  3102.         returning TRUE if and only if the condition is met.
  3103. .
  3104.         Comments:
  3105.              Lower, Item, and Upper can be any combination of 1, 2, and
  3106.         4-byte entities.
  3107. .
  3108.              Note that
  3109.                   BetwU($EA, $EA, $FA) = true
  3110.              whereas
  3111.                   BetwS($EA, $EA, $FA) = false
  3112. .
  3113.         Examples:
  3114.              See TESTBETW.PAS
  3115. .
  3116.         See also:
  3117.              BetwS
  3118.  
  3119. unit ƒShƒUtilPk
  3120.         ƒDELALL
  3121.         Declarations:
  3122.              procedure DelAll(S1, DS : String; S2);
  3123.              function ƒDelAllF(S1, DS : string) : string;
  3124. .
  3125.         Purpose:
  3126.              In string S1 delete all occurrences of DS.
  3127. .
  3128.         Comments:
  3129. .
  3130.         Examples:
  3131.              See the file TESTUTIL.PAS
  3132. .
  3133.         See also:
  3134.              RepAll
  3135.  
  3136. unit ƒShƒUtilPk
  3137.         ƒGETNEXT
  3138.         Declarations:
  3139.              procedure GetNext(var S1, S2 : String);
  3140.              function ƒGetNextF(var S1 : String) : String;
  3141. .
  3142.         Purpose:
  3143.              Returns the next leading substring of S1 which is delimited
  3144.         by a member of DelimSet.
  3145. .
  3146.         Comments:
  3147.              S1 is returned with the sub-string stripped off, but not
  3148.         trimmed. S2 or the function value is trimmed.
  3149. .
  3150.              If S1 is empty on entry, both S1 and S2 (or the function
  3151.         value) will be empty on return.
  3152. .
  3153.         Examples:
  3154.              See the file TESTUTIL.PAS
  3155. .
  3156.         See also:
  3157.  
  3158. unit ƒShƒUtilPk
  3159.         ƒHEX
  3160.         Declarations:
  3161.              function HEX(A : LongInt) : String;
  3162. .
  3163.         Purpose:
  3164.              Converts any INTEGER-type variable into a string
  3165.         correspnoding to the hex value.
  3166. .
  3167.         Comments:
  3168.              The parameter A may be of any Integer type (ShortInt, Byte,
  3169.         Integer, Word, or LongInt
  3170. .
  3171.              HEX will return either a 2, 4, or 8 character string,
  3172.         depending on whether the actual value of the parameter (rather
  3173.         than its type) is representable by a
  3174. .
  3175.                             1 byte value (ShortInt, Byte)
  3176.                             2 byte value (Integer, Word)
  3177.                             4 byte value (LongInt)
  3178. .
  3179.              Note that a negative value will always be returned as an 8
  3180.         character string.
  3181. .
  3182.         Examples:
  3183.              See the file TESTUTIL.PAS
  3184. .
  3185.         See also:
  3186.  
  3187. unit ƒShƒUtilPk
  3188.         ƒHIWORD
  3189.         Declarations:
  3190.              function HiWord(LI : LongInt) : Word;
  3191. .
  3192.         Purpose:
  3193.              Returns the high order word of a LongInt.
  3194. .
  3195.         Comments:
  3196.              This function is the analog of the system function HI, per-
  3197.         forming the analogous operation on a LongInt to that performed by
  3198.         HI on an INTEGER or WORD.
  3199. .
  3200.         Examples:
  3201.              See the file TESTUTIL.PAS
  3202. .
  3203.         See also:
  3204.              LoWord
  3205.  
  3206. unit ƒShƒUtilPk
  3207.         ƒLI
  3208.         Declarations:
  3209.              function LI(Ilo, Ihi : Word) : LongInt;
  3210. .
  3211.         Purpose:
  3212.              Converts two Word variables to a LongInt
  3213. .
  3214.         Comments:
  3215. .
  3216.         Examples:
  3217.              See the file TESTUTIL.PAS
  3218. .
  3219.         See also:
  3220.  
  3221. unit ƒShƒUtilPk
  3222.         ƒLOWORD
  3223.         Declarations:
  3224.              function LoWord(LI : LongInt) : Word;
  3225. .
  3226.         Purpose:
  3227.              Returns the low order word of a LongInt.
  3228. .
  3229.         Comments:
  3230.              This function is the analog of the system function LO, per-
  3231.         forming the analogous operation on a LongInt to that performed by
  3232.         LO on an INTEGER or WORD.
  3233. .
  3234.         Examples:
  3235.              See the file TESTUTIL.PAS
  3236. .
  3237.         See also:
  3238.              HiWord
  3239.  
  3240. unit ƒShƒUtilPk
  3241.         ƒPMOD
  3242.         Declarations:
  3243.              function Pmod(X, Modulus : LongInt) : LongInt;
  3244. .
  3245.         Purpose:
  3246.              Returns the remainder of X on division by MODULUS as a
  3247.         positive number, regardless of the sign of X.
  3248. .
  3249.         Comments:
  3250.              Recall that, e.g., -1 is congruent to (modulus-1). Thus, for
  3251.         example, Pmod(-2, 7) will return 5 as the function value.
  3252. .
  3253.         Examples:
  3254.              (-2 mod 5) = -2
  3255.              Pmod(-2, 5) = 3
  3256.              See the file TESTUTIL.PAS
  3257. .
  3258.         See also:
  3259.  
  3260. unit ƒShƒUtilPk
  3261.         ƒPOSSET
  3262.         Declarations:
  3263.              function PosSet(A : CharSet; S : string) : byte;
  3264. .
  3265.         Purpose:
  3266.              Returns the position of the first occurrence of any member
  3267.         of A in S.
  3268. .
  3269.         Comments:
  3270.              This function is intended primarily for internal use by
  3271.         ShUtilPk and ShCmdLin.
  3272. .
  3273.         Examples:
  3274.                   If   S = 'X1Y2C3Z4B'
  3275.                   and  A = ['A','B','C']
  3276.                   then PosSet(A, S) will return 5.
  3277.              See the file TESTUTIL.PAS
  3278. .
  3279.         See also:
  3280.  
  3281. unit ƒShƒUtilPk
  3282.         ƒREPALL
  3283.         Declarations:
  3284.              procedure RepAll(S1, FS, SS : String; var S2 : string);
  3285.              function ƒRepAllF(S1, FS, SS : string) : string;
  3286. .
  3287.         Purpose:
  3288.              In string S1 replace all occurrences of FS with SS
  3289. .
  3290.         Comments:
  3291. .
  3292.         Examples:
  3293.              See the file TESTUTIL.PAS
  3294. .
  3295.         See also:
  3296.              DelAll
  3297.  
  3298. unit ƒShƒUtilPk
  3299.         ƒSEARCHENVIRONMENT
  3300.         Declarations:
  3301.              function SearchEnvironment(Code : String) : String;
  3302. .
  3303.         Purpose:
  3304.              Searches the environment space for "CODE" and returns the
  3305.         corresponding string.
  3306. .
  3307.         Comments:
  3308.              If the CODE string has not been set with a SET statement,
  3309.         the function will return an empty string.
  3310. .
  3311.         Examples:
  3312.              If the DOS command
  3313.                                  SET GORP=FooBaz
  3314.         has been executed, then
  3315.                             SearchEnvironment('GORP')
  3316.         will return
  3317.                                      'FooBaz'
  3318. .
  3319.         See also:
  3320.  
  3321. unit ƒShƒUtilPk
  3322.         ƒSTARSTRING
  3323.         Declarations:
  3324.              function StarString(Pattern, Target : String) : Boolean;
  3325. .
  3326.         Purpose:
  3327.              This function performs a generalization of the wildcard
  3328.         string matching usually performed by DOS.
  3329. .
  3330.         Comments:
  3331.              The mask is presented in Pattern, and the string to be
  3332.         scanned is presented in Target. The function will return TRUE or
  3333.         FALSE as the target does or does not match the mask.
  3334. .
  3335.              A '*' wild card can be placed anywhere within the mask, and
  3336.         will represent its usual 'zero or more of any characters'. Scan-
  3337.         ning will not be terminated at that point, however, but will con-
  3338.         tinue. Thus, '*B*EFG' will match 'ABCDEFG', but '*B*EGF' will
  3339.         not. Similarly, '*ABC*' will match, but '*ABC' will not.
  3340. .
  3341.              A '?' wild card can also be placed anywhere within the mask,
  3342.         and will also represent its usual 'one occurrance of any char-
  3343.         acter'.
  3344. .
  3345.         Examples:
  3346.                   StarString('*B*EFG', 'ABCDEFG')
  3347.                                                             returns TRUE.
  3348. .
  3349.                   StarString('*B*EGF', 'ABCDEFG')
  3350.                                                             returns FALSE
  3351.                            but would return TRUE using the DOS algorithm.
  3352.              See the file TESTUTIL.PAS
  3353. .
  3354.         See also:
  3355.  
  3356. unit ƒShƒUtilPk
  3357.         ƒUNIQUEFILENAME
  3358.         Declarations:
  3359.              function UniqueFileName
  3360.                       (Path : String; AddExt : Boolean) : string;
  3361. .
  3362.         Purpose:
  3363.              Returns a file name which will be unique in the directory
  3364.         specified by PATH.
  3365. .
  3366.         Comments:
  3367.              On return, the file name will be appended to PATH to give a
  3368.         fully qualified path.
  3369. .
  3370.              If AddExt is TRUE, an extension of .$$$ will be appended,
  3371.         else only the file name will be returned. In either case, the
  3372.         returned entity is guaranteed to be unique.
  3373. .
  3374.         Examples:
  3375.              See the file TESTUTIL.PAS
  3376. .
  3377.         See also:
  3378.  
  3379. unit ƒShƒUtilPk
  3380.         ƒWHOAMI
  3381.         Declarations:
  3382.              function WhoAmI : String;
  3383. .
  3384.         Purpose:
  3385.              Returns the fully qualified path to the currently executing
  3386.         file.
  3387. .
  3388.         Comments:
  3389.              Can be used with DOS 3.x or above, ONLY.
  3390. .
  3391.         Examples:
  3392.              See the file TESTUTIL.PAS
  3393. .
  3394.         See also:
  3395.  
  3396.